Where exactly is it worth placing .GitIgnore File in Android Studio Project

I placed the following .gitignore file in the root of my Android Studio project

# Built application files *.apk *.ap_ # Files for the Dalvik VM *.dex # Java class files *.class # Generated files bin/ gen/ # Gradle files .gradle/ build/ # Local configuration file (sdk path, etc) local.properties # Proguard folder generated by Eclipse proguard/ # Log Files *.log # 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 

However, the following .gradle content continues to be added to the original control.

  modified: .gradle/1.12/taskArtifacts/cache.properties.lock modified: .gradle/1.12/taskArtifacts/fileHashes.bin modified: .gradle/1.12/taskArtifacts/fileSnapshots.bin modified: .gradle/1.12/taskArtifacts/taskArtifacts.bin 

.gradle and its subfolders are marked as ignored in .gitignore, however they are constantly updated every time I run the application in the emulator. I do not remember to deal with them in Eclipse projects.

Are these .gradle files that I showed above need to be versioned, if not, how can I change my .gitignore to actually ignore them?

+5
source share
2 answers

If the .gradle files are already in the git repository, you need to clear them first using git rm -rf gradle/ . Remember to commit changes after using git rm.

+2
source

If you run .gradle / X.XX / ... on the local change tab, use

git rm -rf .gradle/ (NOTE DOT)

otherwise, you will delete the gradle folder, which includes the wrapper folder.

+2
source

Source: https://habr.com/ru/post/1204858/


All Articles