1

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?

Helen Danger Burns
  • 421
  • 2
  • 9
  • 28

1 Answers1

1

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!

CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • Aha! So something like `C:\xampp\htdocs\.gitignore_global` or forward slashes? – Helen Danger Burns Apr 25 '12 at 23:00
  • I've done the above and its still wanting to commit the database file if I change it. I've tried the `git rm --cached application/config/database.php` but it still doesn't work... any ideas? Thanks for your help! – Helen Danger Burns Apr 25 '12 at 23:33
  • if you create another file `database.php`, does it show in `git status`? – CharlesB Apr 25 '12 at 23:39
  • I was being stupid because it's too late - I put the absolute url on the database.php inside the file - no wonder it didn't work! brainfreeze... haha! Sorry, its working fine now - thanks so much for all youy help :) – Helen Danger Burns Apr 25 '12 at 23:43