Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove (forget) a file from SVN?

How do I remove a file from SVN version control?

  • It has previously been committed by someone unintentionally.
  • It is a needed local file, but different for everyone, and needs not be in version control.
  • If I delete & commit, it will delete the file for everyone.
  • I cannot add a file to svn:ignore while it is in the repo.
  • If I remotely remove & locally ignore & commit, it would work, but I cannot commit because I would have to update first, but if I update, the file is removed.

I would like to remove & ignore this file so it doesn't need to be always manually removed from every commit for everyone, without it being deleted locally at anyone.

The "solution" found here doesn't work: https://stackoverflow.com/a/2038639/579078

like image 245
ᅙᄉᅙ Avatar asked Mar 18 '12 19:03

ᅙᄉᅙ


People also ask

How remove deleted file from svn?

Deleting files and foldersUse TortoiseSVN → Delete to remove files or folders from Subversion. When you TortoiseSVN → Delete a file or folder, it is removed from your working copy immediately as well as being marked for deletion in the repository on next commit.

How do I delete a working copy in svn?

If you have a working copy which you no longer need, how do you get rid of it cleanly? Easy - just delete it in Windows Explorer! Working copies are private local entities, and they are self-contained. Deleting a working copy in Windows Explorer does not affect the data in the repository at all.

How do I delete a .svn file in Windows?

All you need to do is download this Windows Registry here and double-click to install. It will add a new right-click menu called “Delete SVN Folders“. By selecting “Delete SVN Folders” it will recursively delete all the child folder . svn in Windows command prompt.


3 Answers

TortoiseSVN has a feature called 'Unversion and add to ignore list' which can be found in the windows explorer context menu (if you have TortoiseSVN configured to show the context menu).

TortoiseSVN documentation article

like image 167
Baldy Avatar answered Oct 04 '22 14:10

Baldy


There really isn't any good way to accomplish this with SVN. About the best you can do is to warn users that they need to update in a certain way for the next update by copying the file out and then back in after the update.

Sometimes, the easiest (or only) way to work around technical issues is with "social engineering".

Lastly, I would highly suggest you switch away from SVN when you get a chance. The other options out there, like Mercurial or Git, are much more forgiving.

like image 39
cdeszaq Avatar answered Oct 04 '22 14:10

cdeszaq


Given that SVN isn't designed to allow this, the best approach might be a two step update wherein the first update renames the file to some unimportant name. Then, email the developers to let them know that after the update they will have to manually copy the file back to its original name. Then, once everyone has handled the update (or ignored it at there peril), you can remove the file from SVN and commit.

like image 21
John Haager Avatar answered Oct 04 '22 14:10

John Haager