git: .gitignore files

What they are for and what to put in them

The .gitignore file is a hidden file in a Git repository that tells Git which files should NOT be committed to the repository.

Examples of files that should NOT be committed:

Each language has its own set of file patterns, e.g.

Some tools, too, have their own set of files that should be in the .gitignore. Github has .gitignore files predefined for frameworks such as Rails and Jekyll (which are both written in the programming language Ruby), the Unity game engine (folks typically write C++ code for this), as well as the Maven version control system.

You can find examples of the files that should be in the .gitignore for various systems by doing a web search on “.gitignore name-of-system-or-tool”.

The repo https://github.com/github/gitignore also has a nice collection of these.

A few useful ones for this course: