Skip to content

Instantly share code, notes, and snippets.

@alienresident
Last active August 29, 2015 13:56
Show Gist options
  • Save alienresident/8963055 to your computer and use it in GitHub Desktop.
Save alienresident/8963055 to your computer and use it in GitHub Desktop.
How to: Merging SVN branches
How to:

Merging SVN branches

Helpful blog post on merging SVN branches

  • check which branch you're on:

    svn info   
  • Switch to your branch (if needed):

     svn switch https://yoursvndomain.com/svn/reference/branches/mybranch/
  • Update your branch:

     svn up
  • get revision number when the branch was created:

     svn log --stop-on-copy

    Branch was created: Revision AAAA

  • switch to trunk

     svn switch https://yoursvndomain.com/svn/reference/trunk/
  • Update trunk to the latest

     svn up
  • take note of that revision - Revision BBBB

  • Merge mybranch to trunk

     svn merge -rAAAA:BBBB https://yoursvndomain.com/svn/reference/branches/mybranch/
    
  • Show updated status

     svn st -u

(If needed) Resolve SVN Conflicts

  • Grep for conflicting files and accept the working version (this is helpful if they're a lot of files that you know are good but didn't have when you branched. As always run a test grep first: svn status | grep C

     svn status | grep C  | colrm 1 8 | xargs echo svn resolve --accept working

Check in Merge to Trunk

  • Check in Merge

     svn ci -m 'Merging mybranch into trunk' 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment