Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Git ignoring my Makefile?

Tags:

git

gitignore

I'm trying to include Makefile in my git repo, but I get this message:

$ 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

In my repo .gitignore file I have:

*.pdf

In my ~/.gitignore_global

#-*-shell-script-*-

# Python
*.pyc

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

build

# Mac
*~
.DS_Store

My .gitignore_global is in git config:

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

My repo is not inside another repo. Why is Git ignoring my Makefile?

like image 694
msampaio Avatar asked Nov 23 '12 13:11

msampaio


1 Answers

Quoting gitignore manual (emphasis mine):

Each line in a gitignore file specifies a pattern. When deciding whether to ignore a path, git normally checks gitignore patterns from multiple sources, with the following order of precedence, from highest to lowest (within one level of precedence, the last matching pattern decides the outcome):

(...)

  • Patterns read from $GIT_DIR/info/exclude.

So you have to check the contents of .git/info/exclude.

like image 157
dusan Avatar answered Sep 23 '22 10:09

dusan