$ cat ~/.gitconfig
[core]
editor = vim
excludefiles = /home/augustin/.gitignore
$ cat ~/.gitignore
toto
$ mkdir git_test
$ cd git_test/
$ git init
$ touch toto
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# toto
nothing added to commit but untracked files present (use "git add" to track)
$ git --version
git version 1.6.3.3
为什么toto没有被忽略?
考虑 ~/.gitconfig 中的其他设置(颜色、编辑器)。
请您参考如下方法:
git config --global core.excludesfile ~/.gitignore