← All files

C++ .GITIGNORE

GitHub’s official C++ .gitignore template.

[ DOWNLOAD ][ MARKDOWN ][ SOURCE ]

GitHub’s official C++ .gitignore template. It is maintained in GitHub’s public template collection and released under CC0-1.0.

USE

  • Copy it to the repository root as .gitignore.
  • Merge it with project-specific patterns; later patterns take precedence.
  • Commit the result so every contributor uses the same rules.

NOTES

  • The template is a starting point; remove patterns you do not need.
  • Generated files should usually stay untracked.

SOURCE

https://github.com/github/gitignore/blob/main/C++.gitignore

FULL TEXT

[ DOWNLOAD ]
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Linker files
*.ilk

# Debugger Files
*.pdb

# Compiled Dynamic libraries
*.so
*.dylib
*.dll
*.so.*

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Build directories
build/
Build/
build-*/

# CMake generated files
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
Makefile
install_manifest.txt
compile_commands.json

# Temporary files
*.tmp
*.log
*.bak
*.swp

# vcpkg
vcpkg_installed/

# debug information files
*.dwo

# test output & cache
Testing/
.cache/

VERIFY SHA-256

Download the file, then choose it here. The checksum is compared locally in your browser.

Expected 3f81ebc82c21e07e8da6423d679e6231d473d892a99d6335af49eea4c754ac27

CITE

C++ .GITIGNORE (v1.0, 2026-11-04). Original. https://original.wales/files/gitignore-cpp/ SHA-256: 3f81ebc82c21e07e8da6423d679e6231d473d892a99d6335af49eea4c754ac27. Source: https://github.com/github/gitignore/blob/main/C++.gitignore.

← All files