不显示带有 git branch -r 的所有远程分支

Doesn't show all remote branchs with git branch -r

当我执行命令时:

git branch -r, 只显示:

origin/HEAD -> origin/master
  origin/development-elton
  origin/master

执行命令时:

git 远程显示来源,它显示:

 remote origin
  Fetch URL: git@bitbucket.org:r2a_/grconsig.git
  Push  URL: git@bitbucket.org:r2a_/grconsig.git
  HEAD branch: master
  Remote branches:
    caio-dev                   new (next fetch will store in remotes/origin)
    controle-usuario           new (next fetch will store in remotes/origin)
    development-elton tracked
    master                     tracked
    rails-admin                new (next fetch will store in remotes/origin)
    **refinancy            new (next fetch will store in remotes/origin)**

如何为我的本地拉分行再融资?

您需要运行git fetch获取最新的分支。

上扩展:

查看所有远程分支(使用单个远程分支):

git fetch
git branch -r

查看所有远程分支(有多个远程):

git remote -v //shows names and URLs of remotes
git fetch --all
git branch -r

如果现有的答案还不够,您可以检查您的.git/config 文件。就我而言,我有以下部分:

[remote "origin"]
        url = https://github.com/John/project1
        fetch = +refs/heads/master:refs/remotes/origin/master

我已将文件编辑为:

[remote "origin"]
        url = https://github.com/John/project1
        fetch = +refs/heads/*:refs/remotes/origin/*

然后,我能够使用 git fetch 获取所有分支。

有时会发生这种情况,如果您更改远程存储库:

git remote set-url origin  https://github.com/John/project1