How to fetch all Git branches

后端 未结 30 1057
情书的邮戳
情书的邮戳 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

    Just these three commands will get all the branches:

    git clone --mirror repo.git  .git     (gets just .git  - bare repository)
    
    git config --bool core.bare false
    
    git reset --hard
    

提交回复
热议问题