Can';我无法让git读取我的$HOME/.gitignore文件

Can';我无法让git读取我的$HOME/.gitignore文件,git,Git,我在Ubuntu 12.04.1上安装了git版本1.7.9.5 我正在尝试设置一个全局.gitignore文件。我可以看到git在strace下打开我的.gitconfig文件(6次!): $ strace -e trace=open git stat 2>&1 | grep gitconfig open("/home/roy/.gitconfig", O_RDONLY) = 3 open("/home/roy/.gitconfig", O_RDONLY) = 3 open

我在Ubuntu 12.04.1上安装了git版本1.7.9.5

我正在尝试设置一个全局.gitignore文件。我可以看到git在strace下打开我的.gitconfig文件(6次!):

$ strace -e trace=open git stat  2>&1 | grep gitconfig
open("/home/roy/.gitconfig", O_RDONLY)  = 3
open("/home/roy/.gitconfig", O_RDONLY)  = 3
open("/home/roy/.gitconfig", O_RDONLY)  = 3
open("/home/roy/.gitconfig", O_RDONLY)  = 3
open("/home/roy/.gitconfig", O_RDONLY)  = 3
open("/home/roy/.gitconfig", O_RDONLY)  = 3
在这个文件中,我有:

[core]
    excludefile = /home/roy/.gitignore
但是strace说它不会打开排除文件:

$ strace -e trace=open git stat  2>&1 | grep  ignore
open(".gitignore", O_RDONLY)            = -1 ENOENT (No such file or directory)
open(".~/.gitignore", O_RDONLY)         = -1 ENOENT (No such file or directory)
我错过了什么魔力?

你应该使用,而不是
排除文件

[core]
    excludesfile = /home/roy/.gitignore

啊,那就行了。谢谢