Renamed file, now SVN not allowing me to commit?

Commit the directory, not the file.

Think of a directory as a text file containing the list of files it contains, then you can see that to commit successfully, you need to update the directory itself so it can remove the old entry and add the new entry. This will show up in SVN as deleting the old and adding the new file (ie 2 changes to the directory, not 1 change to the file)

If only want to commit the 1 file, you will need to add the other changed files to an ignore list temporarily.


Add a file with old name and do commit, Then delete the file again do commit.


Various clients seem to handle this better than others..

AnkhSVN for Visual Studio encounters this error and can't deal with it.

TortiseSVN (shell extension) works though - it knows to delete the old file and add the new one.

So if you're on Windows an easy way to work around this is to use TortiseSVN from Explorer to do a commit on the directory (which deletes the old file name and adds the new one).

Tags:

Svn

Commit