Click here to Skip to main content
15,867,594 members
Articles / Programming Languages / C++
Tip/Trick

Prevent Subversion from doing automatic merges

Rate me:
Please Sign up or sign in to vote.
4.50/5 (4 votes)
14 Feb 2011CPOL 15.6K   1   4
This tip shows how to prevent Subversion (a version/source control tool) from doing automatic merges

Some people don't like the fact that Subversion merges changes from others
with their own local working copy changes automatically on update.
Here's how to force those files into a conflicted state so you can merge manually at your convenience.

1. In TortoiseSVN->Settings->Subversion configuration file, click on the edit button.

2. Change the [helpers] section by adding diff-cmd = "C:\\false.bat" diff3-cmd = "C:\\false.bat" (note the double backslash)

3. Create the file C:\false.bat which contains two lines

4. @type %9@exit 1.

This effectively makes auto-merge fail every time, forcing the file into conflict.
The reason for the curious 'type %9' line is that the diff3-cmd sends the merged output to stdout.
Subversion then takes this and overwrites your local file with the merge results.
Adding this line avoids getting an empty local file.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead Kotha Technologies
Bangladesh Bangladesh
If you are not in - you are out !
- Chapter 1

Comments and Discussions

 
QuestionSeparate lines required in the config file Pin
Member 160456427-Jul-23 2:08
Member 160456427-Jul-23 2:08 
GeneralThnx... I actually got it from someone else and he didn't gi... Pin
Mukit, Ataul21-Feb-11 4:28
Mukit, Ataul21-Feb-11 4:28 
GeneralIf you just copy'n'paste from the TortoiseSVN FAQ, have at l... Pin
SteveKing20-Feb-11 22:07
SteveKing20-Feb-11 22:07 
If you just copy'n'paste from the TortoiseSVN FAQ, have at least the courtesy and link to the original: http://tortoisesvn.net/faq.html#noautomerge
GeneralRe: If you just copy'n'paste from the TortoiseSVN FAQ, have at l... Pin
zincrich25-Apr-14 1:08
zincrich25-Apr-14 1:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.