How to make a commit, or a change permanently local

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 19:11:21

问题


I have changed a file (configuration file) for my project. I would like this change to be only local and therefore disappear from the list of changes ready to be committed.

Is there any easy way to do that? Please note that the configuration file is regularly stored in the repository.


回答1:


One way is:

git  update-index --assume-unchanged -- /path/to/file

Another:

git update-index --skip-worktree -- /path/to/file

(the second will resist to a git reset)

But I prefer using a content filter driver for that kind of local config: versioning a template file, and using values (stored elsewhere) to generate the actual file.



来源:https://stackoverflow.com/questions/14456595/how-to-make-a-commit-or-a-change-permanently-local

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