Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
不';t使用git branch-r显示所有远程分支_Git_Github_Branch_Git Branch_Remote Branch - Fatal编程技术网

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

不';t使用git branch-r显示所有远程分支,git,github,branch,git-branch,remote-branch,Git,Github,Branch,Git Branch,Remote Branch,当我执行命令时: git branch-r,它只是: origin/HEAD -> origin/master origin/development-elton origin/master 执行命令时: git remote show原点,它的显示: remote origin Fetch URL: git@bitbucket.org:r2a_/grconsig.git Push URL: git@bitbucket.org:r2a_/grconsig.git H

当我执行命令时:

git branch-r,它只是:

origin/HEAD -> origin/master
  origin/development-elton
  origin/master
执行命令时:

git remote show原点,它的显示:

 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/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

在添加了
[remote“origin”]
之后,我能够
从Gitlab获取所有的分支。这里可以找到一些解释:谢谢!这是可行的,但如何将其设置为默认值。它是在每个克隆上创建错误的配置!
[remote "origin"]
        url = https://github.com/John/project1
        fetch = +refs/heads/*:refs/remotes/origin/*
git remote set-url origin  https://github.com/John/project1