Android Studio会自动生成一个模板,但是有时候还是有些文件没办法过滤掉,所以就需要手动的添加,一下是在项目中实际应用到的一个ignore文件,这里贴出来,方便以后粘贴复制使用
Built application files
*.apk
*.ap_
Files for the ART/Dalvik VM
*.dex
Java class files
*.class
Generated files
bin/
gen/
out/
Gradle files
.gradle/
build/
*.bin
*.lock
Local configuration file (sdk path, etc)
local.properties
Proguard folder generated by Eclipse
proguard/
Log Files
*.log
Android Studio Navigation editor temp files
.navigation/
Android Studio captures folder
captures/
Intellij
*.iml
.idea/workspace.xml
.idea/libraries
Keystore files
*.jks
.idea/
.app/app.iml
*.iml
taskArtifacts.lock
另外如果需要添加的ignore文件现在立马生效,可在命令行输入命令git rm -r --cached .
,之后再进行提交