4

I have some gitignore files, for example OSX.gitignore, Vim.gitignore and so on. How can I include them all to my global gitignore. Does git support multi global gitignore file?

Ciel
  • 5,551
  • 5
  • 17
  • 24
  • 1
    There's no include syntax per se, but there is this: http://stackoverflow.com/questions/7005142/can-i-include-other-gitingore-file-in-a-gitignore-filelike-include-in-c-langu – John Zwinck Mar 16 '14 at 06:22
  • Does this answer your question? [Can I include other .gitignore file in a .gitignore file? (like #include in c-like languages)](https://stackoverflow.com/questions/7005142/can-i-include-other-gitignore-file-in-a-gitignore-file-like-include-in-c-li) – skywinder Dec 10 '19 at 04:26

1 Answers1

3

According to man gitignore git reads only .gitignore files, $GIT_DIR/info/exclude, and the file configured by core.excludesfile.

You cannot add any other files and the syntax of those files does not support including of other files. The closest you could get is assembling your ignore file automatically by some advanced feature like your own filter driver.

Community
  • 1
  • 1
michas
  • 25,361
  • 15
  • 76
  • 121