Where does the .gitignore file belong?

mishaF picture mishaF · Apr 18, 2011 · Viewed 250k times · Source

Does the .gitignore file belong in the .git folder structure somewhere or in the main source files?

Answer

jmulho picture jmulho · Sep 30, 2013

Put .gitignore in the working directory. It doesn't work if you put it in the .git (repository) directory.

$ ls -1d .git*
.git
.gitignore