Helen Danger Burns
Helen Danger Burns

Reputation: 441

global gitignore being, um, ignored

I am running xampp on my windows machine. I have a load of git repos running locally on c:/xampp/htdocs and wish to add a global ignore to ignore the database config file which is in the applications/config folder of all these repos.

I've created .gitignore_global in the htdocs folder and run git config --global core.excludesfile .gitignore_global whilst in the htdocs folder and then navigated to one of my repos and run git rm --cached application/config/database.php then added, committed and pushed. The file is removed on github, fine, but when I amend database.php and run git status it shows the file there, waiting to be added.... I've researched this and tried a load of things but can't see what I'm doing wrong... any ideas?

Upvotes: 1

Views: 929

Answers (1)

CharlesB
CharlesB

Reputation: 90336

You must specify the absolute path of .gitignore_global in git config --global core.excludesfile, as it is shared by all repositories on your machine git must know where it is!

Upvotes: 1

Related Questions