How to cancel a merge (without commit)?

I just did svn merge to merge the changes from the trunk to the branch:

 $ svn merge -r328:HEAD file:///home/user/svn/repos/proj/trunk . --- Merging r388 through r500 into '.': A foo A bar C baz1 C baz2 U duh [...] 

But there were too many conflicts, so I would like to cancel this.

One way to do this is to lock and then drain back. But I can’t commit because of conflicts. What is the best way to cancel in this case?

+43
merge undo svn commit
Dec 13 '09 at 16:21
source share
4 answers

Restore recursively from the top of the working copy:

svn revert -R .

You will need to manually delete the files that have been added. As after recovery, the added files will remain on the disk, but they will be in the state without tracking ("? Foo")

+103
Dec 13 '09 at 16:24
source share

Until you make a mistake, you can always make a refund to discard all your changes.

+6
Dec 13 '09 at 16:23
source share

I faced the same situation, also I had some other changes that I did not want to lose. So, instead of a full recursive return, only svn revert for conflicting elements was good for me

 svn revert baz1 baz2 
+2
Oct 08 '13 at 13:10
source share

Just make svn resolve for all conflicts and do:

 $ svn resolved baz1 $ svn resolved baz2 $ svn ci -m "oops. bad merge. will revert." Transmitting file data ...... Committed revision 501. 

Then, officially cancel it, going down to where it was:

 $ svn merge -r501:500 --- Reverse-merging r319 into '.': [...] 

What is it, the merge was canceled in the directory. Now also commit this:

 $ svn ci -m "bad merge has been undone" Transmitting file data ...... Committed revision 502. 

Advantage over svn revert -R . method svn revert -R . is that files that have been added are deleted properly.

-eleven
Dec 13 '09 at 16:25
source share



All Articles