Val Okafor Val Okafor - 2 months ago 15
Git Question

Where Exactly Should I Place .GitIgnore File in Android Studio Project

I have placed the following .gitignore file at the root of my Android Studio Project

# Built application files

# Files for the Dalvik VM

# Java class files

# Generated files

# Gradle files

# Local configuration file (sdk path, etc)

# Proguard folder generated by Eclipse

# Log Files

# Windows clutter

# Intellij IDEA (see

However the following .gradle contents keeps getting added to the source control.

modified: .gradle/1.12/taskArtifacts/
modified: .gradle/1.12/taskArtifacts/fileHashes.bin
modified: .gradle/1.12/taskArtifacts/fileSnapshots.bin
modified: .gradle/1.12/taskArtifacts/taskArtifacts.bin

.gradle and its sub folders are marked to be ignored in the .gitignore however these keeps getting updated each time I so much as run the app in an Emulator. I do not remember dealing with these in Eclipse projects.

Are these .gradle files I showed above necessary to be version controlled, if not how can I modify my .gitignore to actually ignore them?


If the .gradle files are already in the git repository you need to clean them up first using git rm -rf gradle/. Don't forget to commit your changes after using git rm.