Best Practices for adding .gitignore file in Android projects

These tutorials talk about which files in the android project are committed and which files are not ignored in a git repository.

Android project gitignore file

gitignore is a text file that contains a list of files or patterns that are excluded while committing an android project.

Following are a list of files and patterns for gitignore files

java files are compiled to class files so class files are not required to commit to the repository

# Java class files

a lot of temporary files are generated.

# generated files

Gradle local files are not required and the build folder contains the build output of a project

# Ignore Gradle files

Configuration files like .iws, .ipr , .iml, local.properties can be excluded

# configuration

Build generated package files

The following generate package files are added.

# built generated package files

Dalvik VM files

# the Dalvik VM files

log files


For key store files


Android projects open in either Android studio as well as Intelli IDEA.

These IDE-related files can be ignored.

# Android Studio / IntelliJ IDEA 

Operation System specific files

# OS temparory files
Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.

Similar Posts
You'll get a notification every time a post gets published here.