以下步骤仅适用于未跟踪的文件。此信息适用于以下配置:
Platform: linux
Git version: git version 1.8.3.1
将要忽略的文件列表放入以下位置的“排除”文件中。
<path till .git directory>/.git/info/exclude
“排除”文件的初始内容
# 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]
# *~
“排除”文件的最终内容
# 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]
# *~
*.tar
*.gch