DEV Community


When to use .gitignore and .git/info/exclude

Bodhisha Thomas
Developer | CSE Undergrad
・1 min read

Both .gitignore and .git/info/exclude are used to ignore files from staging in git.


  • If a file should be ignored in all clones of the repository, you would use .gitignore
  • This file needs to be committed and the files mentioned would be ignored in all the clones.


  • If for some reason you need to locally ignore certain files in a single clone, you would use .git/info/exclude
  • This file acts as a .gitignore for your own local git folder and is not committed or shared with anyone else.


Discussion (0)