Personal tools
You are here: Home FAQ How to ... Branch & Merge using svn

Branch & Merge using svn

by Kuiyu Chang last modified Aug 25, 2008 04:42 PM
  1. Creating a branch (to svn, a branch is just a copy):
      svn copy https://svn.mosuma.com/r9999/proj/A/trunk https://svn.mosuma.com/r9999/proj/A/branches/newbranch
    
  2. Checkout branch:
      svn co https://svn.mosuma.com/r9999/proj/A/branches/newbranch newbranch
    
  3. Change Directory to local branch, work on it:
      cd newbranch
    
  4. Merge newbranch back into trunk. First see what has changed since branching:
      cd newbranch
      svn log --stop-on-copy
    

Note the starting (when branch was created),e.g. 341, and ending revision numbers, e.g. 405

  1. Check out trunk (target for merge):
      cd ..
      svn co https://svn.mosuma.com/r9999/proj/A/trunk projA
      cd projA
      svn merge -r 341:405 https://svn.mosuma.com/proj/A/branches/newbranch
    
  2. Check status, examine changes, compile, test, etc.:
      svn status
    
  3. Commit Merge:
      svn commit -m "Merged newbranch changes r341:405 into trunk"
    

See SVN Book on Branching"

Document Actions
« January 2009 »
January
MoTuWeThFrSaSu
1234
567891011
12131415161718
19202122232425
262728293031