svn ignore a file but include it in checkout
I have a project in a repository. People will soon start checking it out, working on it, then committing their changes back. But there is one file within that project (an elaborate configuration file of my own 开发者_如何学运维design) that everyone simply must have a copy of, but they will make changes to it that should never ever be checked back in (that is never should they be sent via update back to the repository).
So, I want each user who checks out the project to receive this config file, but then I want it ignored on all commits.
What I've read so far makes me feel this is not going to be possible. It seems that once I've imported the project with this config file it is under version control and there is no way anymore to ignore it other than removing it.
I hope I just misunderstood and the solution is an easy one.
Can anyone help?
Oh, I need a command line solution please if possible. A lot of the work is done on headless linux boxes with ssh-only connections.
Thanks!
EDIT: I went with cdhowie's answer. In addition to creating a template config file (for example app.config.template) as he suggests, I also use the "svn propedit svn:ignore" to have the real config file name (for example app.config) ignored on commits.
Usually the way you do this is by providing a template file that the user or a script will copy to where it belongs. That file will then be ignored.
For example, say you have app.config
as the config file. You would commit yours as app.config.template
or something similar. Users would have to copy and rename the file to begin development. app.config
would be ignored in SVN.
This doesn't work cleanly for updates, but it's about the best you can get. Another option would be to set access restrictions in the repository so that app.config
cannot be changed by anyone else.
EDIT: I said that this doesn't work cleanly for updates, but on second thought, if the developers are changing this file a lot anyway, they probably don't want updates from you clobbering their own settings. Using a template file will actually be easier on your developers, since they can pick which changes to merge in themselves.
Actually there are two approaches to 'ignore' commits on a versioned file. The 'template' solution has already been mentioned by @cdhowie. The second approach uses changelists as described in this post.
svn changelist ignore-on-commit file-you-want-to-add
You could modify your project to create a preset version of the file if it doesn't exist.
The file would then not be in SVN at all, and every client would get it the first time they run the code.
The feasibility of this depends on how your project works and where you can put executable code.
精彩评论