What is .gitignore exactly?

Zahachos picture Zahachos · Jan 8, 2015 · Viewed 94.3k times · Source

I just created a Github repository and was wondering what the .gitignore file was for. I started by not creating one, but added one due to the fact that most repositories have one. Do I need to have one? Can/do I just ignore it, or does it have a use? I did some research on the subject but couldn't find a concrete explanation.

Answer

Mureinik picture Mureinik · Jan 8, 2015

.gitignore tells git which files (or patterns) it should ignore. It's usually used to avoid committing transient files from your working directory that aren't useful to other collaborators, such as compilation products, temporary files IDEs create, etc.

You can find the full details here.