' Nothing to push ' error in Android studio with Git

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.