How git clones all the remote branches

Source: Internet
Author: User

Problem:

Wen/Raizhong

At the weekend at home changed the code, a new angular version of the branch, and then push to the coding.net top.
Today, the company does not know how to pull this angular branch to the company's computer. such as (1)

Resolution: (1)

First, you need to clone a local library using the git clone command.
It will then automatically clone a master branch (which is seemingly necessary).
After that, no one will be cloned from the branch.
Assuming you need a dev (assuming that the branch is already in the remote library, which is what you need to clone) for development, you need to create a dev branch of the remote origin to be developed on the Dev branch and create the local dev branch with this command:
$ git checkout-b dev Origin/dev

Re-sync under:
$ git pull

This enables the Clone Dev branch to be implemented.
————————————————————————————
I am also new git, are novice, welcome to cross-examine. ~\ (≧▽≦)/~

Resolution: (2)

Git clone can clone only the master branch of the remote library and cannot clone all branches, the workaround is as follows:

1. Find a clean directory, assuming it is git_work
2. CD Git_work
3. Git clone http://myrepo.xxx.com/project/.git, so you get a project subdirectory in the Git_work directory
4. CD Project
5. Git branch-a, list all branch names as follows:
Remotes/origin/dev
Remotes/origin/release
6. Git checkout-b dev Origin/dev function is to checkout the remote Dev branch, name the dev branch locally and switch to the local dev branch
7. Git checkout-b release origin/release, action see previous explanation
8. Git checkout dev, switch back to Dev branch and start development.

How git clones all the remote branches

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.