Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling conflicts in SVN with Tortoise?

Any time an issue comes up like a merge conflict or something similar, it really slows me down.

Can someone explain to me how to force-resolve conflicts?

For example, a buddy of mine made an edit to a file on the repository and committed. While he was doing that, I had already renamed that file and made many edits to it on my working copy.

When I went to commit, I get the conflict error obviously. The file he edited doesn't even exist anymore on my working copy. How can I tell SVN to simply quit crying about the conflict and force it to accept my working copy (ie, overwrite the head revision with my working copy).

like image 875
KingNestor Avatar asked Jun 30 '09 20:06

KingNestor


People also ask

How do I resolve conflicts in SVN?

To resolve a conflict do one of three things: Merge the conflicted text by hand (by examining and editing the conflict markers within the file). Copy one of the temporary files on top of the working file. Run svn revert FILENAME to throw away all of the local changes.

What is tree conflict in Tortoise SVN?

Since 1.6 version SVN recognizes a new kind of conflict, known as a "tree conflict". Such conflicts manifest at the level of directory structure, rather than file content. Situations now flagged as conflicts include deletions of locally modified files, and incoming edits to locally deleted files.

How can I see SVN conflicts?

Step 1: View Conflicts Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: Subversion is complaining that there is a conflict with the README file, and Subversion does not know how to solve this. So Jerry chooses the df option to review the conflict.


2 Answers

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.

like image 102
bluebrother Avatar answered Oct 21 '22 08:10

bluebrother


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
like image 40
KingNestor Avatar answered Oct 21 '22 08:10

KingNestor