在平时的工作中我们大多数情况下喜欢使用Tortoise SVN之类的可视化版本控制工具,但笔者发现,命令行的方式进行版本控制在执行速度上将会更快一些。尽管在大多数情况下使用命令行并不是很方便,但只要用户习惯了,就非常顺畅了。针对于文件比较则还是可视化的会更加清晰一些。笔者下方展现了常用的SVN命令,供读者查用。
svn checkout svn://xxx.com/xxx/xxx
svn update
svn commit -m "提交描述"
svn add filename
svn add *.php
svn add . --no-ignore --force
svn log test.php
svn svn log -r 100
svn revert test.php svn revert -r 目录名
svn revert --recursive 目录名
svn diff
svn diff test.php
svn diff -r 200:201 test.php
svn diff -r 301 bin
svn status
svn info
svn ls svn ls -r 100
svn blame filename.php
svn cat test.py -r 2
svn cleanup
svn mkdir spool svn propset svn:ignore '*' spool svn ci -m 'Adding "spool" and ignoring its contents.'
svn mkdir spool svn propset svn:ignore 'spool' . svn ci -m 'Ignoring a directory called "spool".'
svn switch svn://xxxx.com/test/branches/online1.0
svn switch --relocate 原svn地址 新svn地址
svn cp -m "描述内容" http://xxxx.com/repos/trunk http://xxxx.com/repos/branches/online1.0
cd branches/online1.0 svn merge http://xxxx.com/repos/trunk
svn merge --reintegrate http://svnbucket.com/repos/branches/online1.0
svn rm http://xxxx.com/repos/branches/online1.0
svn help
svn help commit
svn cleanup [PATH...]