.gitignore

427 阅读1分钟

常用 C/C++ .gitignore

基本原则

一切生成的文件都不放在Git仓库中

白名单

# 忽略一切文件
*
# 除了 .gitignore
!.gitignore
# 除了目录
!*/
# .cpp
!*.cpp
# .c
!*.c
# .h
!*.h
# Makefile
!Makefile*

黑名单

# directory
xtests
tests
test
lib

# Compiled Object files
*.o
*.slo
*.lo
*.ko
*.obj
*.elf
*.d
*.sho

# Precompiled Headers
*.in
*.gch
*.pch

# Compiled libraries
*.dylib
*.dll
*.so
*.lib
*.a
*.la
*.lo
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Fortran module files
*.mod

# vcxproj
*.opensdf
*.sdf
*.suo
GeneratedFiles
ipch
x64

# CMake
build
Makefile*
CMakeCache.txt
CMakeFiles
cmake_install.cmake
install_manifest.txt

# Qt
debug
release
.qmake.stash
moc_*
*.Debug
*.Release
*.pro.user*

# vcxproj
*.opensdf
*.sdf
*.suo
GeneratedFiles
ipch

#vxworks
PPC32e500v2*

# DDS
*.log.*
*.tlog