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

时间:2016-03-01 20:56:00

标签: 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)**

如何为我的本地拉动分支机构的再融资?

3 个答案:

答案 0 :(得分:2)

您需要运行public void onNext(List<SourceObject> srcObjects) { List<ResultsObject> resObjects = new ArrayList<>(); for (SourceObject srcObj : srcObjects) { resObjects.add(new ResultsObject().convertFromSource(srcObj)); } } 才能获得最新的分支。

答案 1 :(得分:1)

扩展mipadi's answer

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

git fetch
git branch -r

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

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

答案 2 :(得分:0)

如果现有答案不充分,您可以查看.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