Global Git ignore

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I want to set up Git to globally ignore certain files.

I have added a .gitignore file to my user root directory (Users/me/) and I have added the following line to it:

*.tmproj

But it is not ignoring this type of files, any idea what I am doing wrong?

Answers

You need to set up your global core.excludesfile configuration file to point to this global ignore file.

e.g.

  • nix:
git config --global core.excludesfile  ~/.gitignore 

Windows git bash:

git config --global core.excludesfile  ~/.gitignore 

Windows cmd:

git config --global core.excludesfile "%USERPROFILE%.gitignore"

For Windows it set to the location C:/users/{myusername}/.gitignore. http://stackoverflow.com/users/265881/muruge http://stackoverflow.com/users/265881/muruge

https://help.github.com/articles/ignoring-files/#create-a-global-gitignore https://help.github.com/articles/ignoring-files/#create-a-global-gitignore

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/7335420/global-git-ignore

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils