Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between .git/info/exclude and .gitignore

Tags:

git

ignore

When I cloned a repo from GitLab to local, it along with source code it also pulled a file in the root folder caller .gitignore. There is also a folder called .git which contains a directory in info contains a file called exclude. Which one is the one that does the ignore (to me ignore and exclude mean the same)? Is it the ignore or exclude?

like image 831
newb7777 Avatar asked Jul 10 '17 16:07

newb7777


1 Answers

They both contain "ignore rules" - filename patterns for which matching untracked files should be ignored.

The difference is that rules in .gitignore are shared through the repo, whreas rules in info/exclude are not. So if for some reason you need to locally ignore certain paths in a single clone, you would use info/exclude; but if a path should be ignored in all clones, you would use .gitignore

like image 67
Mark Adelsberger Avatar answered Oct 28 '22 19:10

Mark Adelsberger