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?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
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 the GIT Integration plugin
File (main menu) >> Settings >> Search for GitHub Integration
Enable Version Control Integration for The Project
VCS (main menu) >> Enable Version Control Integration >> Select GIT
Add project file to Local repository
Right Click on project >> GIT >> Add
Commit Added Files
Open the Version Control windows (Next to terminal window) >> Click commit button
In the prompt window select "commit and push"
Defining Remote
After analyzing code android studio will prompt to review or commit code when committed will be prompt to define the remote repository.There you can add the url to GIT repository.
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)
Open the project you want to push in Android Studio.
Click
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 dogit remote -v
andgit remote rm <remote_name>
to remove.See these pages for details:
http://www.jetbrains.com/idea/webhelp/using-git-integration.html
http://gitref.org/remotes/
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)
First time I have added a video link for solving your problem but I learned it was a bad idea. This time I'll explain it briefly.
Android studio is compatible with github but you need adjust something:
Setup the Github plugins in the Android Studio settings
Download the git version control system from this link and setup https://git-scm.com/
settings >> version control >> git
program files >> git >> bin >> git.exe
Settings >> Version control >> Github
you will see login and password for your Github account. Apply the settings.VCS >> enable version control integration >> git
VCS >> import into version control >> share project on Github
and enter your master password.Now you can use VCS update buttons for updating your project to Github
In Android Studio 0.8.2 , you have the same option (ie Share on GitHub). If you want to find it, you can use ctrl+shift+a and enter github in the input text.
Now you can do it like so (you do not need to go to github or open new directory from git):