SVN commit fails: File already exists
I've got a file (mapViewController.m) which is in svn but I cannot commit changes to it. I tried to c开发者_运维百科opy the file elsewhere and then update. The file does not come with the update so I copy it back. Then I can't commit changes to it.
This is hard to explain what is wrong... because I don't know.
The rule of thumb for all SVN problems is for when you can't figure something out, checkout a fresh copy to a new directory(if possible)
Try doing a fresh checkout and then replacing the file and then committing.
Also, make sure that you don't have to lock that file first.
It sounds a bit like you forgot to do svn add
on the file(or Turotiose SVN -> Add). SVN does recognize directories, but it will not automatically add files in them. You must first add the file(through your subversion client), and then commit it to put it into subversion.
I had the same problem. I had forgotten to update my working copy and tried to commit my changes. So, I did an update for that particular file instead of the entire directory:
svn update filename
svn commit
And it worked.
It sounds like you're doing something fundamental wrong. Maybe you're trying to commit changes without having initially checked out the file, or perhaps you're trying to import
instead of commit
. In any event, I encourage you to read the documentation located here, which will get you started using SVN pretty quickly.
I've had that same error today, it was because I was trying to add a file (add not update) that already existed on the server. What I did was to save my version to an unrelated directory, update to the latest revision and then change the given server file with the one I saved locally, with my changes.
This problem is frequent when I do merge from branche X -> Y, What work usually for me (from Eclipse):
-make a copy of the file/folder (A)
-delete the file/folder from the working repo
-update
-copy file/folder from (step A)
-Commit.
I had solve similar problem with changing working copy depth. I use TortoiseSVN, there are commands:
1) Context Menu → Update item to revision.... Depth: Only this item
2) Context Menu → Update item to revision.... Depth: Fully recursive
All files from repository had come after second one.
精彩评论