[CLI]svn

来源:互联网 发布:python sorted key 编辑:程序博客网 时间:2024/06/07 18:27

声明:本文内容来源互联网,可以转载,无版权!

上次更新时间:FORGET
最近更新时间:201704101944

svn命令可以简写,只要svn能区分它们即可!

################切换用户 ################1.临时切换,在命令下强制加上 --username 和--password选项svn up --username xxx --password xxx#2.永久切换删除目录 ~/.subversion/auth/ 下的所有文件。rm -rf ~/.subversion/auth/################检出<checkout> ###############svn co svn:// 路径(目录或文件的全路径) [本地目录全路径]   --username  用户名 --password 密码################导出<export>#导出的文件会失败版本控制的功能###############svn  export  [-r 版本号]  svn://路径(目录或文件的全路径)[本地目录全路径]################查看文件修改状态#标志参见http://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.status.html################查看当前工作目录的修改情况svn status (stat, st)#查看具体修改了哪些内容svn diff path#查看版本间文件修改svn diff -r v1:v2################查看提交日志################-l指定最近n次的提交svn log [PATH] -ln################删除未被跟踪的文件###############svn st | grep '^?' | awk '{print $2}' | xargs rm -rf################删除未被跟踪的文件#!注意新加的文件不会被删除###############svn revert . --recursive################svn恢复到之前某个版本################1. 临时把当前工作目录中的版本回退到指定版本,不影响repo<svn up会用最新版本替换当前版本>svn up -r vernum#2. 把指定版本当作最新版本,把当前版本当作旧版本,然后进行合并,影响repo<操作后的版本即为最新版本>svn merge -r v2:v1  #操作之后当前工作目录的版本为v1################冲突处理################冲突的部分以本地修改为准 svn resolve –accept mine-conflict #冲突的部分以服务器端修改为准 svn resolve –accept theirs-conflict # Choose the file that was the BASE revision before you updated your working copy. # That is, the file that you checked out before you made your latest edits. svn resolve –accept base # Assuming that you've manually handled the conflict resolution, #choose the version of the file as it currently stands in your working copy. svn resolve –accept working # Resolve all conflicted files with copies of the files as # they stood immediately before you ran svn update.svn resolve –accept mine-full  # Resolve all conflicted files with copies of the files # that were fetched from the server when you ran svn update. svn resolve –accept theirs-full 
0 0
原创粉丝点击