Git:Ignore
lastmod 2026-02-24created 2014-02-169 edits
The .gitignore file is a reserved file that helps you manage which files are excluded from version control.
Categories
How to use
Patterns follow these rules:
- Blank lines and lines starting with # are ignored.
- Standard glob patterns are used.
- A directory is indicated by a trailing slash (/).
- Files matching a pattern that starts with an exclamation mark (!) are not ignored.
The **/ style syntax is available from Git 1.8.2.
Two consecutive asterisks ("**") in patterns matched against full pathname may have special meaning:
- A leading "" followed by a slash means match in all directories. For example, "/foo" matches file or directory "foo" anywhere, the same as pattern "foo". "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo".
- A trailing "/" matches everything inside. For example, "abc/" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth.
- A slash followed by two consecutive asterisks then a slash matches zero or more directories. For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
Git ignore partten
Lists exclusion patterns.
- General: Common exclusions.
[Bb]uild
[Oo]bj
[Bb]in
*.o
[Dd]ebug*
[Rr]elease*
*.mode*
*.app
*.pyc
.svn
*.log
*.cpp.eep
*.cpp.elf
*.cpp.hex
IDE Setting
Exclusions needed when using an IDE.
- XCode IDE
- Code::Blocks
- Visual Studio
- Eclipse
OS
Lists OS-specific special files.
- Linux
- OSX
- Windows
Favorite site
- Create useful .gitignore files for your project
- Git's magic files | GeekNews
- [Original] Git’s Magic Files | Andrew Nesbitt
Pages that link here