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?
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With