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
gitignore ignores only untracked files. Your files are marked as modified - meaning they were committed in the past, and git now tracks them. To ignore them, you first need to delete them, git rm them, commit and then ignore them.
Some times, even if you haven't added some files to the repository, git seems to monitor them even after you add them to the . gitignore file. This is a caching issue that can occur and to fix it, you need to clear your cache.
gitignore file tells Git which files to ignore when committing your project to the GitHub repository. gitignore is located in the root directory of your repo. / will ignore directories with the name.
You can create a . gitignore file in your repository's root directory to tell Git which files and directories to ignore when you make a commit. To share the ignore rules with other users who clone the repository, commit the . gitignore file in to your repository.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With