We covered a lot of ground in this chapter. We discussed the concepts of tags and branches and demonstrated how Subversion implements these concepts by copying directories with the svn copy command. We showed how to use svn merge to copy changes from one branch to another or roll back bad changes. We went over the use of svn switch to create mixed-location working copies. And we talked about how one might manage the organization and lifetimes of branches in a repository.
Remember the Subversion mantra: branches and tags are cheap. So don't be afraid to use them when needed!
As a helpful reminder of all the operations we discussed, here is handy reference table you can consult as you begin to make use of branches.
表 4.1. 分支与合并命令
动作 | Command |
---|---|
创建一个分支或标签 |
svn copy
|
切换工作副本到分支或标签 |
svn switch
|
将分支与主干同步 |
svn merge
|
参见合并历史或适当的修改集 |
svn mergeinfo
|
合并分支到主干 |
svn merge --reintegrate
|
复制特定的修改 |
svn merge -c
|
合并一个范围的修改 |
svn merge -r
|
让自动合并跳过一个修改 |
svn merge -c
|
预览合并 |
svn merge
|
丢弃合并结果 |
svn revert -R .
|
从历史复活某些事物 |
svn copy
|
撤销已经提交的修改 |
svn merge -c -
|
感知合并的检查历史 |
svn log -g; svn blame -g
|
从工作副本创建一个标签 |
svn copy .
|
重新整理分支或标签 |
svn move
|
删除分支或标签 |
svn delete
|