Where does the .gitignore file belong?

Issue

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

Solution

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

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

Answered By – jmulho

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published