SVN 学习笔记

命令参考

Api手册

清除用户密码   

rm ~/.subversion/auth

撤销本地svn操作 svn revert

解决冲突     

 

分支处理

  拷贝分支  

svn copy http://svn.example.com/repos/calc/trunk \
           http://svn.example.com/repos/calc/branches/my-calc-branch \
      -m "Creating a private branch of /calc/trunk."

  分支merge回主干

$ pwd
/home/user/my-calc-branch

$ svn merge http://svn.example.com/repos/calc/trunk
--- Merging r345 through r356 into '.':
U    button.c
U    integer.c
$ svn commit -m "Merged latest trunk changes to my-calc-branch."//有冲突选post,手动解决后,svn resloved,ci提交
 

 

恢复历史版本

//查找历史版本
$ cd parent-dir $ svn log -v … ------------------------------------------------------------------------ r808 | joe | 2003-12-26 14:29:40 -0600 (Fri, 26 Dec 2003) | 3 lines Changed paths: D /calc/trunk/real.c M /calc/trunk/integer.c

 

 将历史版本恢复到现在的版本

$ svn copy http://svn.example.com/repos/calc/trunk/real.c@807 \
           http://svn.example.com/repos/calc/trunk/ \
      -m "Resurrect real.c from revision 807."
Committed revision 1390.

$ svn update
A    real.c
Updated to revision 1390.

  直接获取svn历史版本文件

svn up -r 版本号(不带r) 文件名

 

 

posted on 2013-08-08 01:30  西瓜SY  阅读(263)  评论(0编辑  收藏  举报