Keep settings in branch

这一生的挚爱 提交于 2019-12-01 08:42:40
VonC

In your personal branch, you could keep:

  • the GitHub config file unchanged (with no value), but with a different name (config.template for example)
  • a "value file" with your personal value
  • a "smudge" script able to generate the actual config file using the template one and your personal values

That script is triggered on any git checkout as a content filter driver.

That way, you can merge master onto your personal branch as many time as you want, your config values will not be modified.

You can create a setting file like setting-sample, and modify .gitignore to ignore the real setting file (i.e. setting). So the empty setting file will be kept in remote repo, and your personal setting file will be kept in your local repo.

You may commit the empty settings file and then commit a .gitignore file pointing to the original file, so in that case, the users would download the file but git will ignore the changes that users make.

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