Using the svn command line under windows

http://blog.sina.com.cn/s/blog_7abb28aa0101ji68.html

 

1. Command line svn client under windows

We know that the svn client under linux uses commands to manage the interaction with the server-side svn. Some friends want to have the same function under windows, instead of the GUI management method of TortoiseSVN. This allows us to use the familiar svn command.
 
 
 
      Without installing the TortoiseSVN client, you can  find the svn client tool under windows at http://subversion.apache.org/packages.html#windows . Select Win32Svn  to install.
 
 
       After installation, the bin directory is the corresponding program. Add the bin directory to path by adding environment variables. Start cmd and type svn help to confirm whether the installation is successful.
 
 
      Well, you can find your code and do checkout. In the process of commit code, a problem that often occurs is: svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no 'editor-cmd' run-time configuration option was found
 
 
     This means that your system does not specify what text editor the svn client uses to write commit comments. We add the environment variable, the value of SVN_EDITOR is notepad. svn ci code again. Notepad pops up, save the note after writing. Code submission!
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
2. Use the SVN command line tool, svn download, svn under the windows command line

Get the version of subversion for windows from http://subversion.tigris.org . After installation, there is svn.exe, a command-line-based client tool. Of course, there are also programs on the server side, so I don't care how to configure the SVN service here. The installer adds the path of svn.exe to the path environment variable, and we can use it by directly entering svn on the command line.

If you don't know how to use the svn command, you can query it as follows:
svn help
Know the subcommand, but don't know the usage of the subcommand, you can also query:
svn help ci 

common commands for ci developers

Import project
svn import http:// svn.chinasvn.com:82/pthread --message "Start project"

to export the project
svn checkout http://svn.chinasvn.com:82/pthread

uses the export method to export a "clean" project
svn export http: //svn.chinasvn.com:82/pthread pthread

clears the field for failed transactions
svn cleanup

performs code modification locally, checks the modification status
svn status -v
svn diff

update (update) server data to local
svn update directory
svn update file

adds (add) local data to the server
svn add file.c
svn add dir renames

and deletes files
svn mv bc bb.c
svn rm dc

commits (commit) local files to the server
svn commit
svn ci
svn ci -m "commit" to

view some things related to the log
svn log directory
svn log file : 1. In the local file, each directory has a .svn folder (the attribute is hidden), which saves the relevant information. 2. Register the environment variable SVN_EDITOR as "E:\Program Files\Vim\vim71\gvim.exe". As a result, when svn ci is running, an error occurs: 'E:\Program' is not an internal or external command, nor is it runnable program or batch file. svn: Commit failed (details below): svn: system('E:\Program Files\Vim\vim71\gvim.exe svn-commit.tmp') return 1 Change SVN_EDITOR to "gvim.exe", and in path Add the path "E:\Program Files\Vim\vim71", so that you can use vim to write comments when submitting. Attached:













Websites that provide free SVN services:
http://www.svnhost.cn/ (recommended)
http://www.chinasvn.com
http://www.javaforge.com
http://unfuddle.com
http://svn .coollittlethings.com/index.php (free for open source, fee for private projects)

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

3.http://space.itpub.net/14466241/viewspace-713138

Detailed explanation of the use of SVN command line tools under Windows (additional TortoiseSVN)

Previous  /  Next   2011-12-12 09:32:22 / Top (3) / Personal Category: Network Digest


根据我的记忆,似乎Windows 7下自自带一个svn命令行工具。如果你的机器没有,不必担心。你可以从
http://subversion.tigris.org 获 取subversion for windows的版本,安装之后就有了svn.exe这个基于命令行的客户端工具。安装程序把svn.exe的路径加入了path环境变量,我们已经可以在命令行中直接输入svn就可以使用了。

如今,好用的开源工程遍布世界各地。许多这样的工具都提供了相应的工程源码的SNV下载地址,所以,这个工具你几乎是非了解不可的。以下列出svn使用使用的典型举例。

一、关于命令行工具SVN

如果你不知道命令怎么用svn命令,可通过如下方式查询:

svn help
知道了子命令,但是不知道子命令的用法,还可以查询:

svn help ci 

常用命令格式与举例
导入项目
svn import http://svn.chinasvn.com:82/pthread --message "Start project"

导出项目
svn checkout http://svn.chinasvn.com:82/pthread

采用 export 的方式来导出一份“干净”的项目
svn export http://svn.chinasvn.com:82/pthread pthread

为失败的事务清场
svn cleanup

在本地进行代码修改,检查修改状态
svn status -v
svn diff

更新(update)服务器数据到本地
svn update directory
svn update file

增加(add)本地数据到服务器
svn add file.c
svn add dir

对文件进行改名和删除
svn mv b.c bb.c
svn rm d.c

提交(commit)本地文档到服务器
svn commit
svn ci
svn ci -m "commit"

查看日志
svn log directory
svn log file

二、关于可视化SVN工具TortoiseSVN

到http://tortoisesvn.net/downloads.html处下载可视化SVN工具TortoiseSVN。这个工具非常好用,是一个WINDOWS下可视化工具,特别是 支持断点续传

因此,如果下载小型的SVN内容,使用上面的WINDOWS自带的命令行工具SVN.EXE足够了。但是,当下载大家伙时,常常下载到中间便失去与服务器的联系。如果再重新下载,非常可怜,而且往往还是不行。我在下载LIBGDX这个游戏引擎的源码工具时便是遇到这样的情况。因此才搜索到这个工具。

下载安装后,这个工具是以WINDOWS资源 管理器插件的形式存在的,非常人性化。你只要右键点击一个你想存储下载内容的文件夹,选择“SVN Checkout...”选择,然后弹出一个对话框。此后,你输入你的SVN资源地址,便OK了。而且,这个工具下载速度非常快......

备注:在这个页面http://bbs.mountblade.com.cn/viewthread.php?tid=168300
有几个截图,参考一下吧。

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326727808&siteId=291194637