What files should be in my .gitignore
for an Android Studio project?
I\'ve seen several examples that all include .iml
but IntelliJ docs sa
If you create a Gradle project using Android Studio the .gitignore
file will contain the following:
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
I would recommend ignoring the complete ".idea" directory because it contains user-specific configurations, nothing important for the build process.
The only thing that should be in your (Gradle) project folder after repository cloning is this structure (at least for the use cases I encountered so far):
app/
.git/
gradle/
build.gradle
.gitignore
gradle.properties
gradlew
gradlew.bat
settings.gradle
Note: It is recommended to check-in the gradle wrapper scripts (gradlew, gradlew.bat) as described here.
To make the Wrapper files available to other developers and execution environments you’ll need to check them into version control.