SVN命令行
svn命令 通常都有帮助,可通过如下方式查询:
$ svn help
知道了子命令,但是不知道子命令的用法,还可以查询:
$ svn help add
开发人员常用命令
(1) 导入项目
$ cd ~/project
$ mkdir -p svntest/{trunk,branches,tags}
$ svn import svntest https://localhost/test/svntest --message "Start project"
...
$ rm -rf svntest
(2) 导出项目
$ svn checkout https://localhost/test/svntest/trunk
修订版本号的指定方式是每个开发人员必须了解的,以下是几个参考例子,说明可参考svn推荐书。
$ svn diff --revision PREV:COMMITTED foo.c
# shows the last change committed to foo.c
$ svn log --revision HEAD
# shows log message for the latest repository commit
3) 日常指令
$ svn update
$ svn add foo.file
$ svn add foo1.dir
$ svn add foo2.dir --non-recursive
$ svn delete README
$ svn copy foo bar
$ svn move foo1 bar1
$ svn status
$ svn status --verbose
$ svn status --verbose --show-updates
$ svn status stuff/fox.c
$ svn diff
$ svn diff > patchfile
$ svn revert README
$ svn revert
(6) 分支和合并
建立分支方法一:先checkout然后做拷贝,最后提交拷贝。
$ svn checkout http://svn.example.com/repos/calc bigwc
A bigwc/trunk/
A bigwc/trunk/Makefile
A bigwc/trunk/integer.c
A bigwc/trunk/button.c
A bigwc/branches/
Checked out revision 340.
$ cd bigwc
$ svn copy trunk branches/my-calc-branch
$ svn status
A + branches/my-calc-branch
$ svn commit -m "Creating a private branch of /calc/trunk."
Adding branches/my-calc-branch
Committed revision 341.