UPDATE: This is an old tutorial written for Android Studio Beta. Since then there have been some updates and (although the below will still work) you may find it quicker to follow my updated tutorial How to use GitHub with Android Studio 1.x.
This article will explain how to use GitHub with Android Studio.
Firstly, let’s login to github.com and create a new repository. From the top right corner of the screen, click the + sign and select New repository.
GitHub “New repository” option
Now complete the form to create a new repository called testproject. Leave the Initialize this repository with a READMEunticked.
GitHub create new repository form
Next, open Android Studio and create a new project. Call your new application TestProject. Click Next to continue.
Android Studio new project window
Leave the next page as default and click Next.
Android Studio “Select the form factors your app will run on” screen
On the Add an activity to Mobile screen select Blank Activity and click Next.
Android Studio “Add an activity to Mobile” screen
In the next screen, leave the default activity name of MyActivity and click Finish.
Android Studio “New file options” screen
Your new project will open in Android Studio. On the top menu, select VCS > Import into Version Control >Create Git Repository.
Android Studio “Create Git Repository” option.
On the next screen, leave it all as default and click OK.
Android Studio “Select directory for git init” screen
Now use Internet Explorer and navigate to the root of your projects folder. Right click and select Git Bash (If you do not see this option, then first install Git for Windows).