How to fetch all Git branches

后端 未结 30 1056
情书的邮戳
情书的邮戳 2020-11-22 09:38

I cloned a Git repository, which contains about five branches. However, when I do git branch I only see one of them:

$ git branch
* master
         


        
30条回答
  •  花落未央
    2020-11-22 10:18

    $ git remote update
    $ git pull --all
    

    This assumes all branches are tracked.

    If they aren't you can fire this in Bash:

    for remote in `git branch -r `; do git branch --track $remote; done
    

    Then run the command.

提交回复
热议问题