How to clone all remote branches in Git?

后端 未结 30 2110
情话喂你
情话喂你 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

    #!/bin/bash
    for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do
       git branch --track ${branch#remotes/origin/} $branch
    done
    

    These code will pull all remote branches code to local repo.

提交回复
热议问题