2012-11-23 79 views
5

我想包括Makefile文件我的git仓库,但我得到这个消息:为什么Git忽略我的Makefile?

$ git add Makefile 
The following paths are ignored by one of your .gitignore files: 
Makefile 
Use -f if you really want to add them. 
fatal: no files added 

在我的回购.gitignore文件我有:

*.pdf 

在我的〜/ .gitignore_global

#-*-shell-script-*- 

# Python 
*.pyc 

# Latex 
*.aux 
*.bbl 
*.blg 
*.log 

build 

# Mac 
*~ 
.DS_Store 

我.gitignore_global是混帐配置:

$ git config -l 
core.excludesfile=/Users/marcos/.gitignore_global 

我的回购不在另一个回购。 为什么Git忽略我的Makefile?

+6

文件'.git/info/exclude'怎么办? – dusan

+2

谢谢@dusan。 Makefile文件中有一行。我删除它。你能回答我的问题吗? – msampaio

回答

4

引用gitignore manual(重点煤矿):

在gitignore文件中的每一行指定的图案。当决定 是否忽略的路径,GIT中通常检查gitignore图案从 多个源,具有下面的优先顺序,从最高 到最低(优先的一个级别内,最后的匹配图案 决定结果):

(...)

  • 模式从$ GIT_DIR读/信息/排除

所以你必须检查的.git/info/exclude内容。