2

My colleague has a repository and doing:

$ git remote show origin outputs:

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

The anomaly appears on the line after Local branches configured for 'git pull':

DowSzkDoZgl merges with remote origin/DowSzkDoZgl

Specifically, origin/DowSzkDoZgl.

Why does it specify origin/ in front of the remote branch name? None of the other Pull Config branches have this AND we're already "inside" of origin so it seems redundant.

EDIT
git config:

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

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
Jake Berger
  • 5,237
  • 1
  • 28
  • 22
  • It is likely that the remote branch name is actually `origin/DowSzkDoZgl`. This is still a valid branch name. What do you see in `.git/config` under the `[remote "origin"]` section? – Pascal Belloncle Feb 28 '13 at 00:32

1 Answers1

1

That would reference a branch named 'origin/DowSzkDoZgl' instead of DowSzkDoZgl (that is, a hierarchical branch name, which include a '/')

Try reset the upstream branch with a:

git branch -u origin/DowSzkDoZgl DowSzkDoZgl

(if it complains there is already an upstream, precede that command with a git branch --unset-upstream DowSzkDoZgl)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • my colleague has confirmed that the branch on the remote repo is indeed `origin/DowSzkDoZgl`. So, why is the remote-tracking branch named/setup as just `DowSzkDoZgl`? – Jake Berger Feb 28 '13 at 19:17
  • @jberger1st generally, the *local* branch is correctly named, but incorrectly pushed: `git push origin origin/DowSzkDoZgl` instead of `git push -u origin DowSzkDoZgl` – VonC Feb 28 '13 at 19:32
  • Correct me if I'm wrong: local branch = `DowSzkDoZgl`; local remote-tracking branch = `DowSzkDoZgl`; remote branch (on the remote repo identified as _origin_) = `origin/DowSzkDoZgl`. – Jake Berger Feb 28 '13 at 19:40
  • @jberger1st true, that must be the remote origin which must be incorrectly defined, then. – VonC Feb 28 '13 at 19:41
  • another peculiar issue.. under _Local refs configured for 'git push'_, git displays `DowSzkDoZgl pushes to DowSzkDoZgl (up to date)`. However, shouldn't it read `DowSzkDoZgl pushes to origin/DowSzkDoZgl`? – Jake Berger Mar 12 '13 at 05:47
  • @jberger yes, it should, unless it consider '`origin`' as being the default remote name and not display it. – VonC Mar 12 '13 at 06:32