How can I make git ignore future revisions to a file?

前端 未结 7 1795
盖世英雄少女心
盖世英雄少女心 2020-11-28 18:31

I have created a default version of a file included in a git repository. It\'s important that when someone clones the repository, they get a copy of this file. However, I

相关标签:
7条回答
  • 2020-11-28 19:11

    I found a solution that works for my team. We share our githooks via symlinks and after adding a template file to git I added a pre-commit hook that checks whether the template file has been modified and if so I git reset -- templatefile.txt. If it's the only changed file I also abort the commit.

    0 讨论(0)
提交回复
热议问题