Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 75 Time: 11:20 - Dec 07, 2006  

dustPuppy

How do I remove a file from Subversion without deleting it completely?

I'm using SVN (Subversion) to keep versions of the files I'm working on, but now I want to remove a file from Subversion without removing it completely. I can't see how I can do that?
I'm using the tortoise interface for windows.

Answer Discussion
Tutorials

 

jgivoni

Date:: Dec 08, 2006

Time:: 11:36

If you delete a file from your working copy, the file will be marked as removed from the repository next time you commit your changes (though only if you specifically mark the file in the Tortoise dialogue window - as removed files are not committed by default). Earlier versions of the file will of course still be available in the repository, if you should later wish to revert to a previous version or browse the content. If you want to keep the file - but not under Subversion - you have to copy it to another location outside your working copy.

dustPuppy

Date:: Dec 15, 2006

Time:: 12:25

thanks, jgivoni.
It was the last part i was wondering about. Keeping the file, but not under Subversion.
I find it strange that there isn't any other way to do it. having to remove sounds like a hack.
anyway, thanks for the input.

jgivoni

Date:: Feb 11, 2007

Time:: 12:59

I think I might not have understood your question completely - in fact there is a way to keep the file at it's current location, but not have it version controlled with SVN.
Just use the "ignore" options in Tortoise SVN.

dustPuppy

Date:: Feb 13, 2007

Time:: 05:58

i can't see find any "ignore" option when I right click on the file and go into the subversion menu?
Where did you find that?

jgivoni

Date:: Feb 13, 2007

Time:: 06:15

Actually, the ignore option is only available if the ressource hasn't been added to the repository yet!
So you may need to do the following:
1) Move the file out of the working copy
2) Commit changes and make sure to mark the file for deleting
3) Copy the file back in
4) Select "Add to ignore list" in Tortoise menu

dustPuppy

Date:: Feb 13, 2007

Time:: 06:24

yeah, so it only underlines my first problem: moving a file out of subversion control, without deleting/renaming/moving it.
Strange that that is not possible through the menu options.

jgivoni

Date:: Feb 13, 2007

Time:: 08:34

Yeah, I see what you mean. It could be nice if it could be done in one go.
But I guess SVN doesn't see it as it's problem.

doml

Date:: Aug 02, 2007

Time:: 01:52

There are still problems with this approach. Suppose another user adds inappropriate files to a repository (e.g. a user-specific project preferences file). Then when I update to the latest version, subversion will overwrite my preferences file.

At this point, I want to remove these files from the subversion repository, but not delete them. If I copy them out of the working copy, then do a svn del, and copy them back, the problem is solved from my point of view. But it is not solved from the point-of-view of other users. When they try to update, their preferences file will be deleted. And then they'll be very annoyed!

See the problem?

jgivoni

Date:: Aug 02, 2007

Time:: 02:50

Yes, this can be avoided by simply selecting "Add to ignore list" with TortoiseSVN (as described above).
This will put a property on the parent folder telling svn to ignore certain file name patterns within. The file you wish to ignore has to be a new file that is not yet added to the repository, otherwise TortoiseSVN won't show the ignore option.

doml

Date:: Aug 02, 2007

Time:: 10:32

Well, yes, the right thing to do is not to add those files to the repository in the first place, preferably (as you suggest) by adding to an ignore list.

But is there any way to do this once a file has already, inappropriately been added to a repository? It ought to be possible to release a file from svn control without actually deleting it.

jgivoni

Date:: Aug 02, 2007

Time:: 12:21

It's the same feature dustPuppy was looking for originally (see the beginning of this question).
Unfortunately, I haven't seen this implemented yet, though it could probably be done quite simply - maybe an idea to write to the TortoiseSVN team?

To repeat - the solution for now seems to be:
1. Backup your file
2. Delete it from the repository
3. Copy the file back into position
4. Add it to the ignore list

Jakob

doml

Date:: Aug 02, 2007

Time:: 12:26

Yes, but that still has the problem that when other users update, they will lose their copy of of the file I deleted from the repository. Worse still, SVN won't warn them, or provide any mechanism by which they can recover their file. The only thing that they can do is restore the last repository version.

asdf

Date:: Jan 27, 2010

Time:: 13:34

I really can't just ignore something from SVN without deleting it if it's already been put into the repository...?

That's fucking stupid....

PS: your registration stuff doesn't work with google chrome, I had to tab all over the place to get into the right fields.

amaurylerouxdelens

Date:: Jan 29, 2010

Time:: 05:25

svn delete --keep-local /path/to/the/file

Question Answered

This question has been closed, and points have been rewarded to the following experts:


jgivoni: 75

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

guenthermahr

Date:: Apr 03, 2010

Time:: 12:11

A good way to solve this problem (without using the command line) seems top be:
Right mouse button/Tortoise SVN/Export
and then to export to itself (name the same folder as the export-to folder)
Result: all .svn-folders in all subfolders are removed!


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

dilbertorosa

Date:: Dec 03, 2010

Time:: 20:08

Legal! Muito boa essa dica, obrigado!


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

alishsan

Date:: Feb 08, 2011

Time:: 11:08

use the following command, it keeps the local copy in the working copy, but removes it from the repository:
svn delete --keep-local filename


Click here to see the Answer Discussion that preceded this tutorial.


Login to rate this tutorial: Good  |  Bad

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10279

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es