为什么我的全局.gitignore文件不会被忽略?

aug*_*tin 40 gitignore

$ 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
Run Code Online (Sandbox Code Playgroud)

为什么不被忽略?

〜/ .gitconfig中的其他设置被考虑在内(颜色,编辑器).

sak*_*isk 94

git config --global core.excludesfile ~/.gitignore

  • 我检查并仔细检查了任何拼写错误,但我原来的问题归结为变量设置名称中缺少's'.在应用解决方案后检查配置文件后我意识到了这个问题.谢谢. (8认同)
  • 警告:不要使用相对路径,请使用类似于此答案之一的绝对路径. (2认同)