views:

1364

answers:

3

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).

+1  A: 

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

Devtron
Well, it is happened and Updating Or Committing don't work until it is resolved.
KingNestor
To update frequently, in fact.
anon
Can we rollback his commit some how?
KingNestor
sometimes i have had to backup my work in a seperate folder, delete the repository and re-create my local repository/trunk from SVN Server. You can also try the "Clean Up" and "Resolved" functions, but those usually dont work too great. Just make sure you both have backed up your changes before wiping anything, so you do not lose work. In the future, it is best practice to Update right before you Commit. It can save these headaches.
Devtron
you can rollback a commit by using "Show Log" from the menu. Here is a link from Tortoise on how: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-howto-rollback.html
Devtron
+1  A: 

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
KingNestor
awesome, good job. glad it worked for you!!
Devtron
And your buddy does the same with your commit to fix his working copy? ;-)I would suggest talking to your buddy, committing small logical changes and updating frequently.
Bert Huijben
+2  A: 

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.

bluebrother