SVN Cheatsheet

Partial Merge

Sometimes branches get way out of date and merging all updates from trunk causes way too many conflicts to handle at once. In this case you may want to merge updates from trunk in stages which are easier to handle.

The command below will only sync updates from revisions 5100 to 5150 in trunk down into your branch (assuming you already navigated to within that directory)

svn merge \
-r5100:5150 \
svn:// .

If you did a partial merge before (in this case up to revision 5150) and now want to grab all remaining updates, then just use HEAD like so:

svn merge \
-r5150:HEAD \
svn:// .

Revert (Undo) A Specific Revision

If you made a commit that shouldn't have gone through, it's easy enough to undo. Just find out the ID of that revision and run the command below:

svn merge -c -[revision number] .

Revert (Undo) A Range of Revisions

This is just like before but will undo a range of revisions. I have never had to use this.

svn merge -r [upper revision number]:[low revision number] .




Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to and affiliated sites. More info.