Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN thinks files are already under version control

Tags:

svn

So I have two folders which I want to add to a new repository but they refuse to add because they are already under version control. I deleted all .svn folders in those folders and their subfolders but SVN still knows somehow. How can I see which repo they think they are part of, tell them not to be in there, and put them in the new repo without deleting them or having to move them?

like image 306
hackartist Avatar asked Apr 22 '12 06:04

hackartist


2 Answers

If you have deleted all .svn folders in your local working copy, it shouldn't be versioned anymore. Please note that older version of SVN, use to create a hidden .svn folder in all folders, not only in the root folder or direct subfolders.

You could also do an export command to create a full non-versioned copy in a target directory to avoid the manual delete of .svn folders.

Another issue that could cause this error is that in the new repository, you are already have files or directories with the same name as the directories/files you are trying to add. A good practice would be to import your files in an empty directory to avoid name conflicts.

So, to summarize, the procedure would be like this:

  • export files from your current repository OR delete all .svn folders manually
  • create an empty folder in your new/target repository
  • perform a checkout from the target repository folder to your local copy
  • execute a commit to add all new files
like image 157
Stelian Matei Avatar answered Oct 12 '22 22:10

Stelian Matei


Deleting the .svn folders will not work if those files are already in version control. Here is what you must do:

(1) Delete all folders that are having issues or that you have previously deleted the .svn folders from.

(2) Perform an SVN UPDATE to recreate those folders and get everything BACK into them (even though you'll be removing them in the next step).

(3) Now, delete the folders in question.

(4) Perform an SVN commit, which will commit the removal of these folders from the repository. Now, they're gone from the repository, as you would like.

(5) You can now create the folders again and do whatever you want - create a new SVN repository from them; or re-add them to the existing repository.

It may seem that steps (1)-(2) are redundant and unnecessary; but to be safe, you should do it anyways.

like image 38
Dan Nissenbaum Avatar answered Oct 12 '22 23:10

Dan Nissenbaum