Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: Ignoring an already committed file

I have a settings file that is under version control using subversion. Everybody has their own copy of this file, and I need this not to be ever committed. However, like I said, there is already a copy under version control. My question is: how do I remove this file from version control without deleting everyone's file, then add it to the ignore list so it won't be committed? I'm using linux command line svn.

like image 475
bkildow Avatar asked Apr 03 '09 14:04

bkildow


People also ask

How do I ignore a file in svn?

Use the following command to create a list not under version control files. Then edit the file to leave just the files you want actually to ignore. Then use this one to ignore the files listed in the file: svn propset svn:ignore -F ignoring.

What is ignore list in svn?

The big difference here is that the global ignore list is a client property. It applies to all Subversion projects, but on the client PC only. In general it is better to use the svn:ignore property where possible, because it can be applied to specific project areas, and it works for everyone who checks out the project.

How do I ignore bin and obj folder in svn?

To set your global ignore pattern (with TortoiseSVN) right click Windows Explorer –> TortoiseSVN –> Settings. Once you click on settings enter your global ignore pattern. I'm blocking everything in my bin folder, obj folder, anything that may have been named *.


3 Answers

Make a clean checkout, svn delete the file and add the ignore. Then commit this. Everyone else will have to take care (once) that their local copy isn't deleted on the next svn update, but after that, the local file would stay undisturbed and ignored by SVN.

like image 194
David Schmitt Avatar answered Oct 22 '22 01:10

David Schmitt


If you remove the file from version control, how does a developer new to the project (or the one who accidentally deleted his local copy) get it after initial checkout? What if there are additions to the settings file?

I would suggest the following: Keep a default settings file (with no passwords, hostnames, connection strings, etc.) in SVN, name it something like settings.dist, and let the code work with a copy of this, named settings. Every developer has to make this copy once, and can then work with her personalized settings. If there are additions, add them to settings.dist – everyone else will get them with a update and can merge then into her personalized copy.

like image 38
ax. Avatar answered Oct 22 '22 01:10

ax.


After you delete the file, your users will have to recover the file from the repository using svn export.

$ svn export -r x path ./

Where x is a revision where the file existed before it was deleted, path is the full path to the file, and ./ is where the file will be placed.

See svn help export for more information.

like image 44
matpie Avatar answered Oct 22 '22 01:10

matpie