Version Control with Subversion, 2nd Edition
by C. Michael Pilato, Ben Collins-Sussman, Brian W. Fitzpatrick
Summary
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, Table 4-1 is handy reference table you can consult as you begin to make use of branches.
Table 4-1. Branching and merging commands
| Action | Command |
|---|---|
| Create a branch or tag |
svn copy
|
| Switch a working copy to a branch or tag |
svn switch
|
| Synchronize a branch with trunk |
svn merge
|
| See merge history or eligible changesets |
svn mergeinfo target
--from-source=
|
| Merge a branch back into trunk |
svn merge --reintegrate
|
| Merge one specific change |
svn merge -c
|
| Merge a range of changes |
svn merge -r
|
| Block a change from automatic merging |
svn merge -c
|
| Preview a merge |
svn merge
|
| Abandon merge results |
svn revert -R .
|
| Resurrect something from history |
svn copy
|
| Undo a committed change |
svn merge -c - |