O'Reilly logo

Version Control with Subversion, 2nd Edition by Brian W. Fitzpatrick, Ben Collins-Sussman, C. Michael Pilato

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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
ActionCommand
Create a branch or tag svn copy URL1 URL2
Switch a working copy to a branch or tag svn switch URL
Synchronize a branch with trunk svn merge trunkURL; svn commit
See merge history or eligible changesets svn mergeinfo target --from-source=URL
Merge a branch back into trunk svn merge --reintegrate branchURL; svn commit
Merge one specific change svn merge -c REV URL; svn commit
Merge a range of changes svn merge -r REV1:REV2 URL; svn commit
Block a change from automatic merging svn merge -c REV --record-only URL; svn commit
Preview a merge svn merge URL --dry-run
Abandon merge results svn revert -R .
Resurrect something from history svn copy URL@REV localPATH
Undo a committed change svn merge -c -REV URL; svn commit
Examine merge-sensitive history svn log -g; svn blame -g
Create a tag from a working copy svn copy . tagURL
Rearrange a branch or tag svn mv URL1 URL2
Remove a branch or tag svn rm URL

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required