开发者

How to prevent successive commit on specific file on git?

I have some configuration files to commit on GIT with default parame开发者_Go百科ters. Users can pull these files and can modify them on their local copy but they must not commit/push.

How can I achieve a similar result? the file gitignore doesn't fit my need because file must be commit only the first time


Could you use git's "assume unchanged" function? If this is set, git always assumes that the file in question has not been modified. This means that git status, git commit etc. will skip the file. Please note that the user can still push a new version of the file into your remote repo but it will take some extra work to do that.

Here's a question where the usage of "assume unchanged" was discussed more thoroughly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜