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.
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.
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.
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 *.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With