對(duì)于設(shè)置Git忽略后在提交時(shí)仍然會(huì)看到build目錄下的文件的問題,主要是因?yàn)榫彺鎸?dǎo)致的,所以清除緩存即可
git rm -r --cached .
注意cached后面有個(gè)空格 和 點(diǎn)
然后把build目錄刪除,重新提交即可骄噪,
常用的Git忽略文件配置如下
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
.gradle/
# Signing files
.signing/
# User-specific configurations
.idea/libraries/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
*.iml
# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.iml
.gradle
/local.properties
.idea/
.DS_Store
build/
*/build/*
/captures
.externalNativeBuild