Git - How to automatically ignore a file after a clone?

后端 未结 2 1193
野性不改
野性不改 2021-01-14 18:12

I would know if there is a way to include a file in a repo, but that it is automatically ignored after the user cloned the repo..

It would be great for configuration

2条回答
  •  佛祖请我去吃肉
    2021-01-14 18:27

    One way is to run git update-index --assume-unchanged filename.txt

    Another way is to commit template versions of the files, do your clone, copy the templates and have the copied files in your .gitignore.

    Unfortunately both approaches require you to do something after cloning.

提交回复
热议问题