简体   繁体   中英

Git wont ignore /build/intermediates/ files even though I added build/ to .gitignore

I am doing android development in android studio and i'm trying to ignore all /build/ files but it isn't working. This is my current .gitignore file

# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# built native files
*.o
*.so

# generated files
bin/
gen/

# Ignore gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Eclipse Metadata
.metadata/

# Mac OS X clutter
*.DS_Store

# Windows clutter
Thumbs.db

# Intellij IDEA (see https://intellij-support.jetbrains.com/entries/23393067)
.idea/workspace.xml
.idea/tasks.xml
.idea/datasources.xml
.idea/dataSources.ids

.*
!/.gitignore

but when I do a git status, build files still appear

Chances are they were added to the repo before they were added to the .gitignore file. You should remove them from the repo with git rm --cached filename.ext , and commit (along with the .gitignore file).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM