Android Studio usage for a beginner developer will be very high and grab a great amount of storage memory on your PC.
A simple Hello World program can take around 20+ megabytes as it’s project file total size. In my personal preference, I have to spend around 100s of GBs just to store the sum of my Android Studio project files. This is a case in which you can make use of GitHub, even though there are several other helpful features you can try inside GitHub but a free and trustful cloud storage for your Android Projects is a kind of thing that nobody could ever avoid!
So, in this tutorial, I will explain about connecting Android Studio with GitHub Version Control System (VCS) and uploading our Android Application projects into GitHub respiratory.
You can watch the below video tutorial and understand it simply by listening to the explanation or you can manually read this entire post and squeeze the content.
Let’s get started
I have added this tutorial on two variants, one you can watch and understand it or you can completely read this post. I suggest reading if you want to know each and every point repeatedly, this may take time 🙂
If you want a well-explained video tutorial, then you can watch the below video from my official YouTube channel.
Learn through reading
Reading is a good practice to get a clear idea and this way you can understand it twice powerful!
Step 1: Create an account in GitHub
To begin with, you will have to create an account inside the GitHub if you’re haven’t owned one before. Although it’s completely free of cost!
Step 2: Download & Install Git.exe file
This software is available for Windows, Mac OS, Linux, and Solaris. You can go to the download page and select your preferred, then download and install it.
NOTE: Uncheck all the third-party software (if prompted) while installation.
Step 3: Locate Git.exe file in Android Studio Settings
Once you installed the software, this time to navigate the Android Studio Version Control settings into the installed directory. For this, go to File Settings
From the settings, go to Version Control Git Browse the Git.exe. In Windows OS, by default this is seen in “C:\Program Files\Git\cmd\git.exe” file location. Select the file and click on OK.Once you selected the git file, you can check whether it’s working or not by clicking on the Test button. Possibly this will show a success message and it’s time to hit OK and that will close the Settings window.
Step 3: Login to GitHub from Android Studio
Within the steps, we have successfully added GitHub support into our Android Studio and now it’s time to log in and upload our project. In order to log in to your GitHub account, simply go to VSC Import into Version Control Share Project on GitHub.
Step 4: Enter login credential and set master password
In the popup window, you will have to enter your GitHub user name and password. Sometimes Android Studio asks for creating a master password which will help you double secure your account. Once you gave it you can press the Login button.
Step 5: Name and add description to your project
This step is pretty much straight forward, give a perfect name for your project and add a deep diving description for it. Make sure to keep the Remote name as origin itself and finally hit the Share button.
Process: Adding vcs.xml to Git.
Since it’s not recommended to ignore the entire .idea folder in Android Studio most files in there is tracked by git. The strange thing, however, is that, after every launch, the same line is added to vcs.xml even if there are already dozens of them.
Step 6: Select files to upload into your project
This step is optional, if you want to avoid any personal files from uploading into GitHub, then you can uncheck it from uploading list. You can also add description or file update message from this window.
Process: Pushing project file into GitHub master.
Step 8: Click to open project it on browser
Finally once your pushing complete, you will find a small notification on bottom right corner of your Android Studio. You can hit on the blue colored project name from the message to open it in your default browser.
Now we have our project in proudly hosted on GitHub. You can tell your friend or class mate who’s working with Android App Development to check out your awesome project. Here are link and screenshot of a sample project which I used to make this tutorial.
GitHub link will look like this: https://github.com/sabithpkcmnr/MyProject
There you go! If you went up with any trouble while exercising above steps, then you can ask your question on below comment section. So, we are about to wrap up this tutorial and hope you guys got the idea from this tutorial.
Do you find this tutorial helpful? Do you think respecting the effort and time I took to write this post? If so, please hit the below share buttons to share with your Android loving friends and family members and raise your support. Thank you!