Ignore changes to files that are already in repository

大憨熊 提交于 2021-01-27 23:48:32

问题


Adding files to .hgignore will prevent them from being tracked. But we have some files that we want to be in the repository - we just don't want users to ever commit changes. Is there a way to ignore changes to these files, so they won't get committed in an hg commit.


回答1:


That cannot be done in Mercurial — a file is either tracked or untracked (and then optionally ignored). You should instead version a template file and then ignore the real file.

So add config.template to version control and add config to .hgignore. Ask your developers to copy the template to the real name and customize it as needed.



来源:https://stackoverflow.com/questions/8993500/ignore-changes-to-files-that-are-already-in-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!