svn ignore a file but include it in checkout

前端 未结 3 869
既然无缘
既然无缘 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 16:55

    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.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-11 17:10

    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
    
    0 讨论(0)
提交回复
热议问题