用IDEA建一个空文件 为什么他这个可以出现一个新的空文件 而我啥也没有 是版本问题吗 我的是2021.2.2
第二张图这个 是 创建了一个module
在idea 中根目录中创建.gitignore
文件,常见内容: 添加.idea/
exam.iml
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# custom
.idea/
exam.iml
*.idea/
# 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*
这时idea 在提交的时候还是会出现很多需要的文件,需要执行命令
# 清楚缓存
git rm -r --cached .
# 在清楚跟踪文件缓存时 还需要手动添加要跟踪的文件
这时提交你就会发现少了很多文件