git remote show origin anomaly

时间:2013-02-28 00:15:25

标签: git

我的同事有一个存储库,正在做:

$ git remote show origin输出:

* remote origin
  ...
  Remote branches:
     ...
     DowSzkDoZgl    tracked
     IR-Prod        tracked
     ...
  Local branches configured for 'git pull':
     DowSzkDoZgl    merges with remote origin/DowSzkDoZgl
     IR-Prod        merges with remote IR-Prod
     ...
  Local refs configured for 'git push':
     DowSzkDoZgl    pushes to DowSzkDoZgl         (up to date)
     IR-Prod        pushes to IR-Prod             (local out of date)
     ...

Local branches configured for 'git pull':

之后行显示异常

DowSzkDoZgl merges with remote origin/DowSzkDoZgl

具体而言,origin/DowSzkDoZgl

为什么在远程分支名称前指定 origin / ?其他Pull Config分支都没有这个AND我们已经在 origin 的“内部”,所以它似乎是多余的。

修改
git config:

[branch "DowSzkDoZgl"]
    remote = origin
    merge = refs/heads/origin/DowSzkDoZgl

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*

1 个答案:

答案 0 :(得分:1)

这将引用名为“origin/DowSzkDoZgl”而非DowSzkDoZgl的分支(即hierarchical branch name,其中包含“/”)

尝试使用以下内容重置upstream branch

git branch -u origin/DowSzkDoZgl DowSzkDoZgl

(如果它抱怨已经存在上游,则在该命令之前加上git branch --unset-upstream DowSzkDoZgl