How to fetch all remote branches?

前端 未结 2 1999
天命终不由人
天命终不由人 2020-12-06 13:10

Somehow one of my repositories refuses to fetch new branches:

C:\\temp>git fetch --all
Fetching origin

C:\\temp>git branch -a
* develop
remotes/origin         


        
2条回答
  •  渐次进展
    2020-12-06 13:43

    Check you git config --get remote.origin.fetch refspec.

    It would only fetch all branches if the refspec is

    +refs/heads/*:refs/remotes/origin/*
    

    If the refspec is:

    +refs/heads/develop:refs/remotes/origin/develop
    

    Then a fetch would only bring back the develop branch.
    This is typical of a git clone --branch develop --single-branch.

提交回复
热议问题