How to clone all remote branches in Git?

后端 未结 30 2155
情话喂你
情话喂你 2020-11-22 01:08

I have a master and a development branch, both pushed to GitHub. I\'ve cloned, pulled, and fetched, but I re

30条回答
  •  攒了一身酷
    2020-11-22 01:55

    If you have many remote branches that you want to fetch at once, do:

    $ git pull --all
    

    Now you can checkout any branch as you need to, without hitting the remote repository.


    Note: This will not create working copies of any non-checked out branches, which is what the question was asking. For that, see

    • https://stackoverflow.com/a/4754797/430062
    • https://stackoverflow.com/a/7216269/430062

提交回复
热议问题