Reputation: 2606
I've got the following in my .gitignore:
#built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
# Windows thumbnail db
Thumbs.db
# OSX files
.DS_Store
# Eclipse project files
.classpath
.project
# Android Studio
.idea
build/
cache.properties.lock
.idea/workspace.xml
*.iws
.gradle/
**/.gradle/
However, whenever I make changes to my app, git includes files like .gradle/1.12/taskArtifacts/cache.properties.lock
to the commit.
What's wrong here? Why does it work with the folder build/
but not with .gradle/
?
Upvotes: 21
Views: 20121
Reputation: 3363
It is possible that Git is already tracking these files. Running the following command in terminal worked for me for both .gradle
and .idea
files:
git rm --cached .gradle -r
Upvotes: 58
Reputation: 1706
I had same issue, I hope this will help you:
git rm -rf .gradle/
git rm --cached .gradle -r
Upvotes: 2
Reputation: 81
This could be because the git is already tracking those files. Stop tracking that file then do a commit and push.
In Source Tree:
Upvotes: 3
Reputation: 396
This is common for dot(.) that are not included, add this to .gitignore
.*
!/.gitignore
Upvotes: 3