Handling conflicts in SVN with Tortoise?

扶醉桌前 提交于 2019-12-03 05:37:45

When you update your working copy you can right-click in the log list and chose how to resolve the conflict:

  • resolve using an editor / TortoiseMerge (or whatever merge tool you configured)
  • resolve using "theirs", i.e. the version in the repository
  • resolve using "mine", i.e. your version of the file.

This also works when deleting files properly -- i.e. you need to delete the file using svn if you want to actually delete it from the repository. If you removed the file for convenience reasons you might want to svn revert it before updating as a file missing from the working copy is a modified file too (unsurprisingly).

To sum it up: you can't tell svn to "stop crying" and simply overwrite with your working copy. This is a good thing. You need to resolve the conflict (which could mean simply overwriting the current state), mark the affected files as resolved (svn resolved) and then commit the result.

Here is how I did it:

  1. Right click on the Solutions folder, click TortoiseSVN -> Show Log.
  2. Right click the revision you want to revert, select "Revert Changes from this revision"
  3. Right click the conflicted folders, select "Resolved".
  4. Commit your solution
  5. Profit

I would say: The best way to prevent this from happening is to Update before you...MODIFY the file. Once you are done with your changes you will lose them if you update before you commit!

The best way to prevent this from happening is to Update before you Commit.

Here, it is: If you're in two pane view, then you can only edit the file in the right pane (Mine). To apply changes made in the left file (Theirs), right click on the changed lines and select Context Menu → Use text block from 'theirs' . Then the changes from the left file are added to the right file.

Sometimes you actually want both text blocks, and the context menu also offers you Context Menu → Use both text blocks (this one first) and Context Menu → Use both text blocks (this one last).

If you're in three pane view (sometimes called merge view) you can only edit the file in the bottom view (Merged). As in two pane view, you can right click on conflicted lines and either select Context Menu → Use text block from 'theirs' or Context Menu → Use text block from 'mine' . In addition, if you want both blocks, you can select Context Menu → Use text block from 'mine' before 'theirs' or Context Menu → Use text block from 'theirs' before 'mine' . According to the command you've selected, the changes are used in the resulting Merged file.

Referenced link : https://tortoisesvn.net/docs/nightly/TortoiseMerge_en/tmerge-dug-conflicts.html

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