Git and Github with Android Studio GUI

Git and Github are a version control and code sharing pair. You have most likely heard about them 101 times so no need for any detailed explaining on what they are. In a very simple way of defining both, Git lets you do version control offline. You make a few changes to your code and commit to git at meaningful intervals. While Github, on the other hand, lets you host your code online, it lets you share your code with others or even let them contribute to the codebase.

This post will not explain git terminologies and is not a course on how to use git and github. It aims to teach you how to use git and github right from android studio without typing commands.

You will need to install git on your local machine. A simple Google search like “how to install git on mac” will link you to useful resources if you are a mac user. Replace Mac with your operating system if you are on a different platform.

Now that you have git installed you can open (or create) the project you want to enable version control for on Android Studio (for this post I am using Android studio 3.4).

On the project, navigate to the VCS menu on Android Studio (VCS stands for Version Control System if you are curious). Select VCS -> Enable Version Control Integration.

enable vcs android studio

A dialog will pop-up asking you to select VCS to associate with the project, go ahead and select git and click ok.

If everything worked fine you should get a green notice that says Repository created like on the image below:

At this point, version control is fully enabled for your project and you are ready to make your first commit. If you take a look at your project files, the file names now have a red font color, nothing to panic about :).

Open the VCS menu again and this time select VCS -> commit, to open the commit dialog

Android studio git commit dialog

The commit dialog will show you a list of unversioned files with a checkbox attached to each file/folder and one checkbox to select all files. If you don't have a special need to unselect specific files, check the first box to add all project files to the commit. After that, type a commit message, this is a short message that serves a description for each commit. For this commit, we can type “initial commit” and then hit the commit button.

With the default configuration, android studio will person code analysis after you hit commit. This might take some time and might return a dialog notifying you about TODOs, warning and errors in your code. You can choose to review the code analysis or just ignore it and commit. If everything worked fine you should get that tiny VCS alert again saying “n files committed: initial commit”.

We now have Version control fulling working on our project and the next optional thing is to share our code on github. I will stress optional because you will only use this feature for projects you wish to share or host online.

Go to the VCS menu again and this time, navigate to VCS -> Import into Version Control -> Share project on GitHub.

share project on github

This step requires a github account, you can get one for free at if you don't have one.

Clicking Share project on GitHub will start a wizard that will guide you through Authentication and finally upload your code to GitHub. On the final screen, you will be presented with a dialog to enter details like project description, name remote, make repository private or not. You can leave remote as origin if you do not have any special needs. Click on share and upload will start.

If everything goes fine android studio will display a notification with a link to your new repository. You can share this link with people you wish to share your project with.

In three steps we have looked at how to add VCS to our project and how to share our repository on GitHub with the VCS GUI tool built into Android Studio. There is still a whole lot that you can do with the VCS tool that this post does not cover. Things like importing a project from GitHub. You can play around with the tool to discover more.

Bonus: This tutorial works for IntelliJ, PHPStorm and other JetBrains IDEs.

That will be all from me for now and I hope this post helps somebody. Peace and happy coding.

Extra: Follow me on twitter to get more updates about my tech junks :D

Web/Mobile Developer(Android), I know PHP, SEO+Digital marketing. Currently growing the tech Eco-system in Benue, Nigeria, via BenueTechForum and GDG Makurdi.