Previously, I wrote a post called How to use GitHub with Android Studio, which was based on the beta version of Android Studio. Since then, Android Studio has progressed past the Beta phase and is now officially the primary IDE for Android.
As I expected, they added GitHub support so you no longer have to follow the tutorial in my previous post to use GitHub with Android Studio.
Here is an updated version of this tutorial. I am currently running Android Studio 1.0.2 on Windows 8.1.
Before starting this project, ensure you are registered on GitHub.
First, open your Android Studio project and select VCS >Import into Version Control > Share Project on GitHub
You will be presented with a login screen, enter your GitHub username and password and click Login.
If this is the first time setting up a password in Android Studio you will be prompted to create a password database. If so, enter a master password (and again to confirm). I would suggest checking the Encrypt master password with user credentials box.
Next, you will see the Share Project on GitHub prompt. Enter a name for your new repository and a description. Then click Share to continue.
Next, you will be prompted with the Add Files for Initial Commit screen. This is where you can select the files to commit to your Git repository before you push it to GitHub. Usually you will want to select all files, however there are some cases where you may wish to exclude certain files which contain security keys, passwords etc… Check the files and click OK to push to GitHub.
If everything went well, you will see a message right at the bottom of Android Studio which says Successfully shared project on GitHub: <Project Name>.
If you login to GitHub and navigate to your repositories, you will see the new project in there.
Thank you for reading! Check my other post How to clone a GitHub project on Android Studio for the demo on how to consume a cloned project.