3

I have updated android studio from 3.0.0 to 3.3.2. Everytime I build project files like .idea/caches/build_file_checksums.ser and .idea/caches/gradle_models.ser get added to git. This files are already present in .gitignore.This is my Project level .gitignore file

*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
/.idea/tasks.xml
/.idea/misc.xml
/.idea/modules.xml
/.idea/vcs.xml
.DS_Store
/build
/captures
/.idea/caches/build_file_checksums.ser
/.idea/caches/gradle_models.ser
.externalNativeBuild

What changes need to be done in project to get rid of this ?

Satyam Gondhale
  • 1,415
  • 1
  • 16
  • 43

2 Answers2

2

Please change the .gitignore file as follows. You are telling it to find the files in the root location.With below configuration, it will look in the project directory. This should resolve the issue.

*.iml
.gradle
local.properties
.idea/workspace.xml
.idea/libraries
.idea/tasks.xml
.idea/misc.xml
.idea/modules.xml
.idea/vcs.xml
.DS_Store
build
captures
.idea/caches/build_file_checksums.ser
.idea/caches/gradle_models.ser
.externalNativeBuild

You will have to delete the files from the git cache and re-commit.

Mo Ziauddin
  • 380
  • 1
  • 13
0

Check first if those files are not already tracked with:

git rm --cached .idea/caches/build_file_checksums.ser
git rm --cached .idea/caches/gradle_models.ser

If you can remove those files, then (commit and) they will be ignored

Check they are ignored with:

git check-ignore -v -- .idea/caches/build_file_checksums.ser
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250