Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: Folder already under version control but not comitting?

Tags:

svn

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?

like image 424
mpen Avatar asked Feb 08 '11 22:02

mpen


People also ask

Is not under version control svn commit?

The error means that you've tried to commit a file that is not under version control. You should svn add it first. However, there is a chance that you made some unintentional changes in your working copy. You must do svn update and analyze your local uncommitted modifications with svn status .

How to remove a folder from Tortoise svn?

You right click on the directory, go to TortoiseSVN -> Delete. You then right click on the parent directory and SVN Commit... and that will remove the folder. This will delete the folder as well.


2 Answers

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.

like image 64
Tomasz Nurkiewicz Avatar answered Sep 30 '22 12:09

Tomasz Nurkiewicz


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
like image 28
Tobias Avatar answered Sep 30 '22 14:09

Tobias