global .gitignore not ignoring files

Viewed 652

So I thought I am smart and downloaded the recommended gitignore repo and and wrote a script that makes one big gitignore out off all of them and be set for an easy future with git.

I followed this tutorial: https://www.youtube.com/watch?v=3LYBdd3RGKs git knows the file exists and has access

I looked at a lot of tutorials and they all end up verifying with that line.

I thought maybe gitignores have a size limit but i didn't find anything hinting at that.

1 Answers

A "global" .gitignore (one which would apply to all your local repositories) would be a file reference by git config --global core.excludesfile ~/.gitignore (as seen here or here)

But don't forget it won't applied automatically to files already tracked in a repository.
For a file already committed, you would need to rm it first (git rm --cached -- aFile)

Then you can check it is indeed ignored with:

git check-ignore -v -- aFile
Related