SVN remains in conflict?
Asked Answered
M

12

301

How do I get this directory out of conflict? I don't care if it's resolved using "theirs" or "mine" or whatever...

PS C:\Users\Mark\Desktop\myproject> svn ci -m "gr"
svn: Commit failed (details follow):
svn: Aborting commit: 'C:\Users\Mark\Desktop\myproject\addons' remains in conflict

PS C:\Users\Mark\Desktop\myproject> svn resolve --accept working C:\Users\Mark\Desktop\myproject\addons
Resolved conflicted state of 'C:\Users\Mark\Desktop\myproject\addons'

PS C:\Users\Mark\Desktop\myproject> svn ci -m "grr"
svn: Commit failed (details follow):
svn: Commit item 'addons' has copy flag but an invalid revision

PS C:\Users\Mark\Desktop\myproject> svn update
   C addons
svn: Can't move 'addons\debug_toolbar\templates\debug_toolbar\.svn\tmp\entries' to 'addons\debug_toolbar\templates\debug
_toolbar\.svn\entries': The file or directory is corrupted and unreadable.

PS C:\Users\Mark\Desktop\myproject> svn cleanup

PS C:\Users\Mark\Desktop\myproject> svn update
Skipped 'addons'
At revision 51.
Summary of conflicts:
  Skipped paths: 1

PS C:\Users\Mark\Desktop\myproject> svn ci -m "grrr"
svn: Commit failed (details follow):
svn: Aborting commit: 'C:\Users\Mark\Desktop\myproject\addons' remains in conflict
Murvyn answered 9/3, 2010 at 3:35 Comment(3)
the answer is: [svn resolved filename] do this rather than the accepted solution. – Gerbold
@TravisSchneeberger the accepted solution is fine πŸ˜‰ – Festoonery
svn resolved *filename* doesn't fix it for me. – Reversioner
R
484

Give the following command:

svn resolved <filename or directory that gives trouble>

(Thanks to @Jeremy Leipzig for this answer in a comment)

Raynard answered 31/5, 2011 at 6:34 Comment(4)
Seriously, if you don't care how it's resolved (maybe you're just going to delete it anyway) this is the right answer. – Sharl
This doesn't solve anything. The error will probably arise again at the next commit. – Normandnormandy
Thanks a lot ,it works for me! You must in your svn root repo, you can use this command! – Coastward
For those saying this doesn't really fix anything, you're only partly right. Sometimes you need to run "svn resolved" on the parent directory, all the way up to the root of the application. Then check it with another "svn up". The problem is an "issue" with SVN where if you manually copy a file from one working tree to another identical working tree, and on "update" or "commit" SVN gets confused to find the file is there already. I would call this a "bug" but I'm sure others would call it "user-error." – Amortization
L
275

Ok here's how to fix it:

svn remove --force filename
svn resolve --accept=working  filename
svn commit

more details are at: http://svnbook.red-bean.com/en/1.8/svn.tour.treeconflicts.html

Lu answered 29/12, 2010 at 2:58 Comment(2)
If you are working with the Eclipse IDE, you can also apply my "non command line" solution, which I described in a separate answer below. – Linus
using svn 1.7.4, svn help resolved states that it "has been deprecated in favor of running 'svn resolve --accept working'." – Penult
S
42

For me only revert --depth infinity option fixed Svn's directory remains in confict problem:

svn revert --depth infinity "<directory name>"
svn update "<directory name>"
Spikenard answered 20/10, 2014 at 7:42 Comment(4)
to revert a whole directory of files or a file does not exist anymore – Touraine
To resolve the conflict of locally deleted files which exists on the server, this option worked.. – Cleasta
Thanks a lot. "svn revert --depth infinity ." worked for me and restored deleted files, which didn't reappear just with "svn up" – Hughs
Indeed, works actually quite fine ! – Soutor
L
18
  1. svn resolve
  2. svn cleanup
  3. svn update

..these three svn CLI commands in this sequence while cd-ed into the correct directory worked for me.

Laflam answered 6/12, 2013 at 13:27 Comment(1)
@Elad Tabak: In my case I had to do it to the parent directory of the file giving me trouble, this might be what you ran into – Kal
L
11

If you are using the Eclipse IDE and stumble upon this error when committing, here's an in-tool solution for you. I'm using Subclipse, but the solution for Subversive could be similar.

What you maybe didn't notice is that there is an additional symbol on the conflicting file, which marks the file indeed as "conflicted".

Right-click on the file, choose "Team" and "Edit conflicts...". Choose the appropriate action. I merged the file manually on text-level before, so I took the first option, which will take the current state of your local copy as "resolved solution". Now hit "OK" and that's it.

The conflicting symbol should have disappeared and you should be able to commit again.

Linus answered 21/3, 2013 at 8:22 Comment(1)
Also, in case of directory conflict, you can do "Team->Show Tree Conflicts" and then review all those conflicts and mark them as Resolved (in a separate "SVN Tree Conflicts" window) – Areca
P
6

One more solution below,

If the entire folder is removed and SVNis throwing the error "admin file .svn is missing", the following will be used to resolve the conflict to working state.

svn resolve --accept working "file / directory name "
Prochora answered 26/11, 2013 at 9:55 Comment(0)
B
5

I use the following command in order to remove conflict using command line

svn revert "location of conflict folder" -R
svn cleanup
svn update

for reverting current directory

svn revert . -R
Branch answered 8/3, 2018 at 4:3 Comment(3)
Hahahaha, no don't do this. It'll do bad things. – Hallah
It would obviously revert your changes – Branch
it actually works for some problems like conflict and could only resolve via cli – Harebell
C
4

Instructions for Tortoise SVN

Navigate to the directory where you see this error. If you do not have any changes perform the following

a. Right click and do a 'Revert'
b. Select all the files
c. Then update the directory again

Cyclograph answered 30/3, 2017 at 11:11 Comment(0)
I
3

If you have trouble resolving (like me) and you cannot delete and update the resources because you have made many changes on them, plus you are using eclipse subversive instead of native client, follow these steps:

  1. make a copy of your entire project dir
  2. perform team>disconnect within eclipse, and choose to delete the svn metadata
  3. then choose team>share project, and point to the very same folder that your project resides in
  4. choose yes, and commit everything (you may want to exclude some very local resources, like configuration files)
  5. if you have deleted or moved some resources prior to your first commit trial, delete those old resources (they should have doubled up, one in old location, one in new) and commit those deletions.

You're done.

Immaculate answered 12/4, 2012 at 14:28 Comment(0)
N
2

I guess the proper solution is:

(1) backup your-file/your-directory
(2) svn revert your-file/your-directory
(3) svn update your-file/your-directory
(4) Merge the backup your-file/your-directory to the updated one.
(5) svn ci -m "My work here is done"
Nail answered 2/12, 2016 at 21:0 Comment(0)
A
0

I had similar issue, this is how it was solved

xyz@ip :~/formsProject_SVN$ svn resolved formsProj/templates/search

Resolved conflicted state of 'formsProj/templates/search'

Now update your project

xyz@ip:~/formsProject_SVN$ svn update

Updating '.':

Select: (mc) keep affected local moves, (r) mark resolved (breaks moves), (p) postpone, (q) quit resolution, (h) help: r (select "r" option to resolve)

Resolved conflicted state of 'formsProj/templates/search'

Summary of conflicts: Tree conflicts: 0 remaining (and 1 already resolved)

Auria answered 10/9, 2015 at 5:2 Comment(0)
A
0

I had the same issue on linux, but I couldn't fix it with the accepted answer. I was able to solve it by using cd to go to the correct folder and then executing:

svn remove --force filename  
syn resolve --accept=working filename  
svn up

That's all.

Ambivert answered 4/12, 2017 at 6:27 Comment(1)
In the second line, it is svn not syn – Beardless

© 2022 - 2024 β€” McMap. All rights reserved.