Subversion - Branching and Tagging

subversion

How can we switch the working copy to another branch?

svn switch branchURL

How can we list branches?

svn list REPO_URL/branches/

How can we create a branch from existing branch?

svn copy $REPOS/branches/existingBranch $REPOS/branches/newBranch

How can we create a branch from the trunk?

svn copy $REPOS/trunk $REPOS/branches/newBranch

How can we merge change from branch A to branch B?

If you've made a change on branch A, and want to merge this change into branch B:

1.  When you check into branch A, subversion give you a revision number (for example 9842)
2.  cd b  (b is a checkout of branche B)
3.  svn merge -r 9841:9842 $REPOS/branches/A
4.  svn ci -m "some comment"

How can we find out which revision a branch was created?

svn log --stop-on-copy

How can we get a list of files that were modified and committed into a branch?

svn log -v -q -r rev &> out

sort out2 > out3
uniq out3

http://wiki.fluidproject.org/display/fluid/Subversion+Tips+and+Tricks

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License