12

I've got a file (mapViewController.m) which is in svn but I cannot commit changes to it. I tried to copy 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.

2
  • Make sure the file hasn't become readonly. Commented Dec 3, 2009 at 19:02
  • Yeah, SVN will automatically mark files for addition, and then complain that they already exist. That is just gehy... In short, SVN is quite finicky. Commented Apr 27, 2012 at 7:12

6 Answers 6

15

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.

Sign up to request clarification or add additional context in comments.

2 Comments

For me, checking it out again worked, something must have just been messed up in the .svn files or something.
Deleting the local project and checking out again worked. The .svn was clearly bad and just updating didn't work. Reason was that the svn crashed in the final phases of commit process.
12

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.

3 Comments

+1 for this. In my case, doing a svn update at the top level didn't update this file for some reason. Doing this brought my file into conflict and allowed me to resolve it. After that, the commit went off without a hitch.
Kudos. I did an 'svn update' from the command line at the top directory of the project, then went back to my Eclipse svn and was able to check in the files I had changed.
Perfect Fixed my problem
1

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.

Comments

1

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.

Comments

1

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.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.