In Android Studio, how does Git update the local remote branch list ?, Androidgit

Source: Internet
Author: User

In Android Studio, how does Git update the local remote branch list ?, Androidgit

For example, if your colleague adds branch xxx in Git's remote branch, but you find that when you view the existing branch in Android Studio, you cannot see the branch he added. If you view branch, please stamp this: how does Android Studio view the branch list and switch branch,

The command line method is as follows: git branch-a or git branch-r.

If you can see the newly added branch, there are two ways:

Method 1: git fetch


Method 2: git remote update origin -- prune. Note that if your remote branch is not under 'origin', replace 'origin' with your name.


You can use the command line directly on git bash or terminate in Android Studio.

Before using Android Studio, configure the git bin directory as an environment variable (with path)


Git add git push-u origin master and then prompt: Branch master set up to track remote branch master

Git add. # add the file to stage area
Git commit # submit the file and prompt to enter the commit message
Git push-u origin master # push to the remote warehouse and set the tracking branch. When you push it next time, just enter git push and you will be awake, the system automatically uses the local master branch to track the remote master branch.

Actual use of git's "branch"

[Then I create another version library through git clone and can only obtain the code of the remote origin master branch.]

After cloning, you can check the log 'there should be a branch01 branch log '~

After you clone it, it is in the master branch 'You Need to checkout' ~ by default '~

[Git checkout branch01]

Related Article

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.