SVN: Folder already under version control but not comitting?

Svn

Svn Problem Overview


mark@mark-ubuntu:~/myproject$ svn stat
?       runserver.sh
?       media/images/icons
?       apps/autocomplete
mark@mark-ubuntu:~/myproject$ svn add apps/autocomplete
svn: warning: 'apps/autocomplete' is already under version control

svn stat says its not under version control, so I try to add it, and then it tells me it is. When I do an svn ci, it doesn't get comitted, and doesn't show up when I try to browse to repository online.

How do I get it to commit?

Svn Solutions


Solution 1 - Svn

Copy problematic folder into some backup directory and remove it from your SVN working directory. Remember to delete all .svn hidden directories from the copied folder.

Now update your project, clean-up and commit what has left. Now move your folder back to working directory, add it and commit. Most of the time this workaround works, it seems that basically SVN got confused...

Update: quoting comment by @Mark:

> Didn't need to move the folder around, just deleting the .svn folder and then svn-adding it worked.

Solution 2 - Svn

I had a similar-looking problem after adding a directory tree which contained .svn directories (because it was an svn:external in its source environment): svn status told me "?", but when trying to add it, it was "already under version control".

Since no other versioned directories were present, I did

find . -mindepth 2 -name '.svn' -exec rm -rf '{}' \;

to remove the wrong .svn directories; after doing this, I was able to add the new directory.

Note:

  • If other versioned directories are contained, the find expression must be changed to be more specific
  • If unsure, first omit the "-exec ..." part to see what would be deleted

Solution 3 - Svn

A variation on @gauss256's answer, deleting .svn, worked for me:

rm -rf troublesome_folder/.svn
svn add troublesome_folder
svn commit

Before Gauss's solution I tried @jwir3's approach and got no joy:

svn cleanup
svn cleanup *
svn cleanup troublesome_folder
svn add --force troublesome_folder
svn commit

Solution 4 - Svn

(1) This just happened to me, and I thought it was interesting how it happened. Basically I had copied the folder to a new location and modified it, forgetting that it would bring along all the hidden .svn directories. Once you realize how it happens it is easier to avoid in the future.

(2) Removing the .svn directories is the solution, but you have to do it recursively all the way down the directory tree. The easiest way to do that is:

find troublesome_folder -name .svn -exec rm -rf {} \;

Solution 5 - Svn

Have you tried performing an svn cleanup?

Solution 6 - Svn

Check for a directory 'apps/autocomplete/.svn'. Move it somewhere safe (in case you need to restore it because this did not work) and see if that fixes the problem.

Solution 7 - Svn

I found a solution in case you have installed Eclipse(Luna) with the SVN Client JavaHL(JNI) 1.8.13 and Tortoise:

Open Eclipse: First try to add the project / maven module to Version Control (Project -> Context Menu -> Team -> Add to Version Control)

You will see the following Eclipse error message:

org.apache.subversion.javahl.ClientException: Entry already exists svn: 'PathToYouProject' is already under version control

After that you have to open your workspace directory in your explorer, select your project and resolve it via Tortoise (Project -> Context Menu -> TortoiseSVN -> Resolve)

You will see the following message dialog: "File list is empty"

Press cancel and refresh the project in Eclipse. Your project should be under version control again.

Unfortunately it is not possible to resolve more the one project at the same time ... you don't have to delete anything but depending on the size of your project it could be a little bit laborious.

Solution 8 - Svn

For me doing a svn update, followed by svn commit worked. There were no .svn folders present in folder which was failing to add.

Solution 9 - Svn

Just rename the problematic file, Commit, rename it to the original name and commit

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmpenView Question on Stackoverflow
Solution 1 - SvnTomasz NurkiewiczView Answer on Stackoverflow
Solution 2 - SvnTobiasView Answer on Stackoverflow
Solution 3 - SvnhobsView Answer on Stackoverflow
Solution 4 - Svngauss256View Answer on Stackoverflow
Solution 5 - Svnjwir3View Answer on Stackoverflow
Solution 6 - SvnjerrybView Answer on Stackoverflow
Solution 7 - SvnChisey88View Answer on Stackoverflow
Solution 8 - SvnSujeetView Answer on Stackoverflow
Solution 9 - SvnAhmed_magView Answer on Stackoverflow