SVN常用命令学习笔记

1. svn common commands
     1.1 typical working cycle
              a. update your working copy
                    svn udpate
             b. modification
                    svn add
                    svn delete
                    svn copy
                    svn move
             c. verify modification
                     svn status
                    svn diff
                    svn revert
             d. merge others' modification
                  svn update
                    svn resolved
             e. submit modification
                  svn commit
                 
     1.2 resolve conflicts (confliction files: filename.mine,
              filename.rOLDREV, filename.rNEWREV)
             a. abandon the modification: svn revert <filename>
             b. remove conflicts temp files: svn resolved
                 note: once the temp files is deleted with 'svn resolved',
                           you can submit your file, even though there still are
                           conflicts in the file.

     1.3 check the history
             a. svn log
             b. svn cat
             c. svn list
             d. svn diff

     1.4 Misc.
             a. svn cleanup
             b. svn import
             c. svn info

2. branch, tag, merge
     2.1 svn branch is a copy
            create branch: svn copy <src_svn_path> <dest_svn_path> -m "<comments>"
     2.2 merge to current local copy
            merge branch: svn merge -r <ver1:ver2> <dest_svn_path>
            example:
             $ svn merge http://svn.example.com/repos/branch1@150 /
                                   http://svn.example.com/repos/branch1@212 /
                                   my-working-copy
             $ svn merge -r 100:200 http://svn.example.com/repos/trunk my-working-copy
             $ svn merge -r 100:200 http://svn.example.com/repos/trunk
     2.3 preview the merge: svn merge --dry-run .....
     2.4 svn merge --ignore-ancestry
              $ svn diff --notice-ancestry
     2.5 find the log from where the branch creates
              $ svn log --verbose --stop-on-copy <svn_branch_path>
     2.6 copy file from a svn old version, and add it to svn
              $ svn copy -r <ver> <svn_path_filename> <path_filename>
     2.7 transform an existing working copy to reflect a different branch: svn switch
              Note: Not only can working copies contain a mixture of working
                        revisions, but a mixture of repository locations as well.
    
     2.8 svn tag is copy, there is no diifference between a tag and a branch
              create tag: $ svn copy  <src_svn_path> <dest_svn_path> -m "<comments>"


3. setup svn server
    3.1 startup svn server
        $ svnserve -d -r /SVN/xxxxx/
    3.2 modify svn user name and passwd
        modify file: <storage>/conf/passwd

 

4. generate and apply patch

    4.1 Generate Patch:
        #svn diff > xxx.patch


    4.2 Apply Patch:
        #patch -p0 < xxx.patch


5. Appendix:

$ svn log <filename> -r <key|time|ver>    
$ svn diff -r <key|ver> <filename>

Show the latest changes in the repository
#svn log -r 'BASE' -v

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值