Use Git under Android Studio
Reference: HTTP://WWW.TUICOOL.COM/ARTICLES/V7J6ZFQ
1. Prepare to install Git:
sudo apt-get install Git-core
Reference: https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-12-04
To set up a Git plugin in Android Studio: File->setting->version Control->git, then you can click on test, such as: then you set it up successfully.
2. Initialize the GIT project (git init)
The operation is as follows: Vcs->enable Control integration->select "Git".
3. Add remote to Git
In this step, studio does not provide us with a visual GUI, switches directories to the project directory under Terminal, and then enters the git add remote command, for example: Git remote add origin "https://github.com/ Xxx/xxx.git ".
4. Add code to VCS (git add)
Select the file you want to submit->vcs->git->add
5. Commit changes (git commit)
Vcs->commit changes can choose commit and push at the time of submission, it can push directly to the server.
There may be a "nothing to push" issue at the first commit
Reference: Http://stackoverflow.com/questions/15913669/nothing-to-push-error-in-intellij-with-git
Since the first commit, Repository is empty, no master, you need to tick the checkbox at the bottom of the push interface and select "Push current branch to alternative branch" and fill in as Master, so that you can build master, then push will not need a checkbox, unless you add a new branch.
When you push to a empty repository you must set in CheckBox "push current branch to alternative branch" and Cho OSE as that master alternative. It ' s because is not master created yet (repo isreally empty). But doing this is the pretend to initialize the repository.
While the checkbox is off and repository are empty, idea can ' t push, because it interface must be safe and he'll not Ju ST Create new Brach if the one in which-pushed last accidentally disappeared (or just not exist). You must "branch creation"
' Nothing to push ' error in Android studio with Git