
Select `Git -> Pull` to pull any changes from Github:Ĭheck the box reading "github/master" and then select "Pull"ĭid you get an error when pulling? Check the (#Troubleshooting). Select `VCS -> Commit` to commit any changes to Git:Ĭheck the box on any changes, type a commit message and hit "Commit": Make sure you named the remote as "github" Paste that into the remote url with name as "github": Select "+" to add your github repo as a remote:Ĭopy the Git Repo URL **for your project repo** (SSH or HTTPS) Committing your files into the local repo Connecting your local project to your Github repoģ. In this guide we will be doing the following:Ģ. The repo might be blank, with maybe just a README: This guide connects your Android Studio project to an existing Github repo you already created. Don’t believe me? Logon and check for yourself.Īnd that’s it! I hope you found this post helpful? Let me know in the comments below.# Android Studio - Enable Git Version Control on Existing Repo Now your code is pushed to your GitHub repository. If it’s all good, you will see this message. Now enter your GitHub Login (email address) and Password. Now, right click the project name, select Git > Repository > Push.Ĭheck the box Push current branch to alternative branch and leave the branch name as master. (Unless it’s a real project, in which case review and fix the issue before committing!) If a Code Analysis warning appears, click Commit. In the next screen, type a Commit Message and select Commit. Now right click the project name again and this time select Git > Commit Directory. It will seem like nothing has happened, but trust me, the project files are added. This will add all your project files to your Git repository. Next, jump back into Android Studio, right click your projects root directory and select Git > Add. The GitHub remote will be added to your Git repository. When the Git bash screen appears, type: git remote add origin /.git Right click and select Git Bash (If you do not see this option, then first install Git for Windows). Now use Windows Explorer and navigate to the root of your projects folder. On the next screen, leave it all as default and click OK. On the top menu, select VCS > Import into Version Control > Create Git Repository. Your new project will open in Android Studio.

In the next screen, leave the default activity name of MyActivity and click Finish. On the Add an activity to Mobile screen select Blank Activity and click Next. Leave the next page as default and click Next. Next, open Android Studio and create a new project. Leave the Initialize this repository with a README unticked. Now complete the form to create a new repository called testproject. From the top right corner of the screen, click the + sign and select New repository.

This article provides a basic overview of how to use GitHub with Android Studio.įirstly, let’s login to and create a new repository.
