Reputation: 282895
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?
Upvotes: 113
Views: 153464
Reputation: 1788
I just use --force
flag every time:
svn add --force example/folder/*
Upvotes: 0
Reputation: 260
Just rename the problematic file, Commit, rename it to the original name and commit
Upvotes: 0
Reputation: 1
For me doing a svn update, followed by svn commit worked. There were no .svn folders present in folder which was failing to add.
Upvotes: 0
Reputation: 609
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.
Upvotes: 0
Reputation: 19259
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
Upvotes: 15
Reputation: 340753
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.
Upvotes: 165
Reputation: 2653
(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 {} \;
Upvotes: 14
Reputation: 2561
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:
Upvotes: 20
Reputation: 1639
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.
Upvotes: 3