svn ignore a file but include it in checkout

前端 未结 3 870
既然无缘
既然无缘 2020-12-11 16:31

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

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 17:09

    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.

提交回复
热议问题