我想从提交中自动排除 2 个文件,它们是 git 存储库的一部分,但有一些更改,不应该是 github 存储库的一部分,因为它们有一些更改只对我的本地系统有意义,而不是其他开发商。
我将它们添加到.git/info/exclude
希望 git 明白他不应该对它们进行更改:
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
a.conf
b.conf
# *~
但git status
仍将它们列为已提交:
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: build/conf/a.conf
# modified: build/conf/b.conf
#
我不想在每次提交时定期取消它们(有一次我可能会忘记),我该怎么做?