- 添加.gitignore文件后并沒有忽略我們想要忽略的文件喻括,解決方法就是清除一下緩存非迹,原因gitignore對已經追蹤(track)的文件無效惯裕,清除緩存后文件將以未追蹤的形式出現(清楚后編譯器關閉重新打開一下玄叠,重新加載刷新一下文件)欣尼,然后再重新添加提交一下祸穷,.gitignore文件里的規(guī)則就可以起作用了性穿。
- git rm -r --cached .
- 關閉編譯器重新打開
- git add .
- git commit -m 'update .gitignore'
- git push -u origin master (如果有遠程倉庫則使用)
# Built application files
*.apk
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
build/
# 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/
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches
.idea/modules.xml
.idea/navEditor.xml
.idea/Project.xml
.DS_Store
.cxx
# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
# Google Services (e.g. APIs or Firebase)
# google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
# Version control
vcs.xml