Handling SVN conflict
When firing the SVN update statement I am getting the conflicts. How can I keep my version and check that in. What is the command for t开发者_运维技巧hat?
If you're using a shell client like TortoiseSVN, then right click "resolve using mine" as @Adi mentions.
On the command line, it's
svn resolve --accept mine-full <FILENAME>
If you are working in the command line instead of using a UI, svn will ask you when you do "svn update" something like:
Conflict discovered in 'bar.c': (p) Postpone (e) Edit (tf) Theirs-full (mf) Mine-full
What you want is mine-full (mf). Of course this will overwrite any changes that the other person made, so you may instead want to (e)dit.
If you choose to (p)ostpone this, you will need to change the file later and mark it as resolved (svn resolved ), followed by a svn commit.
On the command line:
svn resolve --accept working <FILENAME>
Just for anyone who has many conflicts and doesn't want to resolve them one by one, keeping yours changes, just run this:
svn resolve . -R --accept mine-full
Related SO question
Your problem is that both of you have edited the same part of a file. As soon as you did that, there was going to be trouble down the line. SVN's doesn't do file level locking (for good reason!), so assumes that you won't both make changes within a few lines of each other.
If you happen to be using Visual Studio, I've been working on a tool that will highlight parts of the file you are editing that have been changed by someone else.
Right click the conflicting file and choose "use mine". FYI, the other alternative is "use theirs". Of course this requires UI.
精彩评论