How do you synchronise projects to GitHub with Android Studio?
I am trying to synchronise a project that I have on in my Android Studio folder to GitHub, but I am not fully sure what to do other than adding my credentials in the options menu. Could someone give me a quick guide, please?
Open the project you want to push in Android Studio.
VCS -> Enable version Control Integration -> Git
There doesn't seem to be a way to add a remote through the GUI. So open Git Bash in the root of the project and do
git remote add <remote_name> <remote_url>
Now when you do
VCS -> Commit changes -> Commit & Push you should see your remote and everything should work through the GUI.
If you are getting the error:
fatal: remote <remote_name> already exists that means you already added it. To see your remotes do
git remote -v and
git remote rm <remote_name> to remove.
See these pages for details:
Read more... Read less...
Following method is a generic way of pushing an Android Studio project to a GIT based repository solely using GUI.This has been tested with a GIT repository hosted in Visual Studio Online and should virtually work with GitHub or any other GIT based version control provider.
Note: If you are using GitHub 'Share on GitHub' is the easiest option as stated in other answers.
Enable Version Control Integration for The Project
Commit Added Files
Open the Version Control windows (Next to terminal window) >> Click commit button
In the prompt window select "commit and push"
Then enter the credentials for the repository and click 'Ok'.(Visual Studio online Users need to enable "alternate authentication credentials" as mentioned here to login to repository)
On Android Studio 1.0.2 you only need to go VCS-> Import into Version control -> Share Project on GitHub.
Pop up will appear asking for the repo name.
In the version of Android Studio I have (0.3.2), it was as easy as using the menu.
VCS Menu > Git > Share on GitHub.
It will then ask you for your credentials, and then a name for your new repo, and that's it!
This isn't specific to Android Studio, but a generic behaviour with Intellij's IDEA.
Go to: Preferences > Version Control > GitHub
Also note that you don't need the github integration: the standard git functions should be enough (VCS > Git, Tool Windows > Changes)
For Android Studio 0.8.9:
VCS --> Import into version contraol --> Share project on Github. It doesn't give you option to share in a specific repository or at least I couldn't find (my limitation!).
You can add your github info here:
File --> Settings --> Version COntraol --> Github.