.gitignore 是一个文本文件,用于告诉Git哪些文件或目录在版本控制中应该被忽略。当你执行 git add 命令时,Git会参考 .gitignore 文件的内容,不会将其中指定的文件添加到暂存区。
这里只给出常用的Java和python的设置
python项目中
Byte-compiled / optimized / DLL files
pycache/
*.pyc
*.pyo
*.pyd
C extensions
*.so
Distribution / packaging
/dist/
/build/
*.egg-info/
Logs and databases
*.log
*.sql
*.sqlite
IDEs and editors
.idea/
.vscode/
*.iml
bash
# Byte-compiled / optimized / DLL files
__pycache__/
*.pyc
*.pyo
*.pyd
# C extensions
*.so
# Distribution / packaging
/dist/
/build/
*.egg-info/
# Logs and databases
*.log
*.sql
*.sqlite
# IDEs and editors
.idea/
.vscode/
*.iml
Java项目中
Compiled class file
*.class
Log file
*.log
BlueJ files
*.ctxt
Mobile Tools for Java (J2ME)
.mtj.tmp/
Package Files
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
java
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
