Home » Android » version control – What to commit into VCS from a Gradle project in Android Studio

version control – What to commit into VCS from a Gradle project in Android Studio

Posted by: admin April 23, 2020 Leave a comment

Questions:

I am using Android Studio 0.4.6 and Gradle 1.10.
I want to commit into git the necessary files and folders, so that anyone cloning the repository can start working with the project and will not have any issues of missing files/settings because of not commited file.
Could someone point what is needed to be into VCS and what is optional.

From question: “gradle directory in an Android Studio project” I see that the gradle/ folder is good to have it, but what about .idea/, .gradle/, gradlew.bat etc…
I see inside local.properties that it should not be commited, but what about everything else?

Here is my .gitignore that works perfect for me now:

/app/build
.idea/workspace.xml
.idea/tasks.xml
.gradle
local.properties
How to&Answers:

You can take a look at What should be in my .gitignore for an Android Studio project?

If you use the .gitignore file from that questions you shouldn’t have any problems.

I think that if you create a new project inside a git directory Android Studio will automatically create the necessary .gitignore files for your project.

EDIT:
Actually it seems that my Android Studio always generates .gitignore files when I create a project.