Problem
You have an existing GitHub project and would like to import it to Android Studio.
Solution
Perform the following steps to import your project.
Step 1: Install git for Windows
It can be downloaded for free from git-scm.com.
Most settings available during the installation process should be compatible with Android studio. Just choose the settings you deem the most appropriate.
Step 2: Link git executable to Android Studio
Open Android Studio and got to Settings. In the Setting dialog open the page Version Control / Git. Here define the path to the git executable you have just installed.
Step 3: Get the Path to your Repository from Github
Go to the GitHub page and get the HTTPs path to your repository. For instance:
https://github.com/mxro/WallOfTheWiseAndroid.git
Step 4: Import the Git project to Android Studio
Go to Android Studio and go to Menu / VCS / Checkout from Version Control / Git
Paste the HTTPS path you obtained from GitHub in the previous step and click on [Clone].
Provide your GitHub username and password.
Now the project should be imported to Android Studio and you should be able to commit and push future changes back to GitHub.
References
Android Studio Git Tutorial (Part 1) « Wii’s Blog
github – How to clone a remote git repository with Android Studio? – Stack Overflow
Nice tutorial for windows based machines. For MacOS or Unix installations checkout my blog
Nice writeup! In addition if you want to just import the GitHub project as a jar/aar dependency then you can use https://JitPack.io. It wasn’t around at the time of writing but now it lets you depend on GitHub repositories directly. Happy building!
JitPack looks very useful! I will definitely try it out.
Thanks a lot. It saved my time…..
Thank you very much!!!! this means a lot
Thank you.. Helpful 🙂
Where can I find the Setting tab?
I believe it’s under Menu File / Settings.
hey you skipped somewhere.Do we have to make a new project and import that github project to this created project? i think this android studio should add to new import option like “open existed android studio project”,”open github project by git link” etc
Hi! Thank you for your question.
Yes, you will need an existing GitHub project for this!
After clicking on “Clone” the software didn’t ask me to enter my Github credentials, but a window named “Import Project from Gradle” opened. If I click OK, I get this error message:
“SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable. Consult IDE log for more details (Help | Show Log)”
I don’t know where is the problem, it’s the first time I’m using Android Studio.
Sounds like the path to the Android SDK might be missing in some way.
You can download the SDK and then go to Tools / Android / SDK Manager to set the correct path.
Hope this helps and good luck!
Ok, thank you very much!
Nice one also if you have any ui or ux designs that can be implemented through android studio can you please contact me