Remove files after svn add but before committing

Oops…

You’ve added a whole directory to get checked into subversion, and then realized at the last minute that you forgot to remove the binaries, or perhaps you had some hidden files, .nfs0001 or maybe even a thumbs.db or something else you just don’t want to commit.

You already marked them all with “svn add”, but you can stop these files from getting committing by using “svn revert”.

$ svn revert .nfs0001

But I already committed them!

If you didn’t notice these files until after the commit, you can remove them using “svn del”, and if that doesn’t work try adding “–force” to the delete command.

Since subversion only plows ahead and never actually backtracks, the space will still be lost on the server backend, but at least your extraneous files will be removed from the current snapshot. And who knows, perhaps one day you’ll find a need for the random files you committed that one time. You can always check out that revision and get those files back.

I just wish there was a super user oops command that really lets me go backwards and remove all reference to something in subversion. Sometimes you just really-really-really want to delete something, and this situation is probably exactly that one time.

Posted by admica   @   10 February 2010

Related Posts

Like this post? Share it!

Digg Twitter StumbleUpon Delicious Technorati Facebook RSS

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« Weekly Contest - Battlefield Bad Company 2 Beta
Next Post
ATI fglrx driver - fix corrupt amdpcsdb »
Powered by Wordpress   |   Lunated designed by ZenVerse