Get Tortoise SVN to remove files from control

Everybody who has been programming on any large scale, or decent sized project involving several people will be at least familiar with revision control systems such as SVN and CVS.

One of the most popular systems at this time is Subversion (SVN), and if you are using Windows the Tortoise SVN client will most likely be your svn client of choice.

However a little know feature is the extended context menu for tortoise. Most evident if you need to remove a file from revision control but keep the file locally on your computer. Normally if you use svn delete the file will be marked for deletion, and upon next commit the file will be removed from the reposiroty AND your local machine.

Luckily there is a quick little trick to simply remove it from revision control but still keep your local copy. If you press and hold shift while right clicking the file(s)/directory(s) a new command under the TortoiseSVN menu is available called “Delete (Keep local)”.

This marks your selection to be removed from the repository upon next commit, but retains your local copy. This is especially usefull for files that should not have been added in the first place, but where you still need a copy of the file locally e.g. for building a project.

To sum up you can extend the capabilities of TortoiseSVN using your shift button! Great little tip! 😀

Extended SVN menu

Extended menu

source:
http://tortoisesvn.net/node/347

5 Responses to “Get Tortoise SVN to remove files from control”

  1. Lex Robin says:

    In SmartSVN this feature in more obvious: when invoking the Remove command, a dialog with the options “Remove from SVN control and delete locally” and “Just remove from SVN control” is shown.

  2. erik says:

    What if you want to do the reverse: keep the file under svn control but delete the local files? If you just delete the files directly after checkout, svn naturally will want to check them out again on synchronization, so that’s not the way to go. Is there a svn:ignore type thing but at checkout rather than checkin?

  3. swoop says:

    Not sure what you want here ?
    You want to delete the file locally but NOT have it there under SVN control ? Well you can of course just delete the file, and it will be gone until next svn update.
    You can ignore files from svn, but not the way you are asking (afaik). But you could easily just delete the file and it will be gone until next checkout 🙂

    Does that help you ?

  4. Michael says:

    What happens if you choose to SVN Delete (Keep Local) and someone else does an update? Will their copy be deleted completely or just removed from SVN?

    I did a quick test, and it looks like SVN marks the file for deletion, regardless if you choose to keep a local copy – causing anyone else’s copy to be removed completely when they do an update.

    Is there a way to simply remove a file from SVN control, but have everyone’s copy kept local?

    thanks
    Michael

  5. swoop says:

    I actually havent tested what happens with multiple people… my initial thought would be that its simply marked to be removed .. but the keep local could be a local operation not helping other people using the repository. Going to try and check into that later today.
    But if it does remove it from everybody elses checkouts i dont know a way to prevent that.. i searched a good while to simple find out how to keep a local copy 🙂

Leave a Reply