git - 不使用 git branch -r 显示所有远程分支

标签 git github branch git-branch remote-branch

当我执行命令时:

git branch -r,它只显示:

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

执行命令时:

git remote show origin,它显示:

 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)**

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

最佳答案

如果现有的答案还不够,您可以检查您的.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

关于git - 不使用 git branch -r 显示所有远程分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35733312/

相关文章:

Gitk:默认将 "Ignore space change"选项设置为 true

git - 如何有效地导航 Git 存储库以跟踪项目开发?

github - AWS CodeBuild Github webhook 不更新 PullRequest 的状态

git - 使用 Github,是否可以查看某个文件在某个提交时的样子,而不仅仅是差异?

Git:删除单个远程修订

git - 如何使用 Git 删除远程分支?

git 在树中向前移动一个分支的起点

git - 在 git scm 中撤消 "git checkout HEAD foo.c"

git - 我如何使用 Git 忽略 CVS 目录?

关于静态变量优化的 C 分支