svn常用命令汇总

来源:互联网 发布:c语言中eof怎么用 编辑:程序博客网 时间:2024/06/08 04:46

(1) 导入数据到版本库
svn import (copy an unversioned tree of files into a repository)

(2) 初始化检出
svn co (checkout)

(3) 更新工作拷贝
svn up (update)

(4) 做出修改
svn add/delete/copy/move

(5) 检验修改
svn status/diff

(6) 取消修改
svn revert

(7) 解决冲突
svn up (update)

conflict options:
(p) postpone, mark the conflict to be resolved later
(df) diff-full, show all changes made to merged file
(e) edit, change merged file in an editor
(r) resolved, accept merged version of file
(mf) mine-full, accept my version of entire file(ignore their changes)
(tf) their-full, accept their version of entire file(lose my changes)
(l) launch, launch external tool to reslove conflict
(h) help

svn resolve
–accept ARG(base, working, mine-conflict, theirs-conflict, mine-full, theirs-full)

(8) 提交修改
svn commit

(9) 检验历史
svn log
svn diff
svn cat (retrieves a file as it exsisted in a particular revision number and displays it on your screen)
svn list (displays the files in a directory for any given revision)

(10) 获得旧的版本库快照
svn checkout -r xxx
svn update -r xxx

修订版本关键字:
HEAD 版本库中最新版本
BASE 工作拷贝中一个条目的修订版本号
COMMITTED 项目最近修改的修订版本号,与BASE相同或更早
PREV COMMITTED-1

eg:

$ svn diff -r PREV:COMMITTED foo.c# show the latest change committed to foo.c$ svn log -r HEAD# show log message for the latest repository commit$ svn diff -r HEAD# compares your working copy (with all of its local changes) to # the latest version of that tree in the repository$ svn diff -r BASE:HEAD foo.c# compares the unmodified version of foo.c with the latest version of foo.c# in the repository$ svn log -r BASE:HEAD# show all commit logs for the current versioned directory since you last updated$ svn update -r PREV foo.c# rewinds the last change on foo.c, decreasing foo.c's working version$ svn diff -r BASE:14 foo.c# compares the unmodified version of foo.c with the way foo.c looked # in revision 14
0 0
原创粉丝点击