Handling SVN conflict

浪尽此生 提交于 2019-12-01 14:26:38

问题


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 that?


回答1:


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>



回答2:


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.




回答3:


On the command line:

svn resolve --accept working <FILENAME>



回答4:


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.




回答5:


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




回答6:


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



来源:https://stackoverflow.com/questions/5479962/handling-svn-conflict

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