Handling SVN conflict

别来无恙 提交于 2019-12-01 15:59:38
Babak Naffas

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>

Right click the conflicting file and choose "use mine". FYI, the other alternative is "use theirs". Of course this requires UI.

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.

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!