How git clones all the remote branches

Source: Internet
Author: User
Tags git clone

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.

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.