3

Why when I run 'git remote show ' why it said

  HEAD branch (remote HEAD is ambiguous, may be one of the following):
    dev
    master
  Remote branches:
    dev                                   tracked
    master                                tracked

why git does not know the remote HEAD branch?

michael
  • 106,540
  • 116
  • 246
  • 346

1 Answers1

0

Because the SHA1 reference by remote/HEAD is the same than remote/master or remote/dev.

You can find more details at "Error with git: remote HEAD is ambiguous, may be one of the following".

As mentioned in this more recent thread (2011):

Right. The transport protocol doesn't expose the name that a symbolic reference points to, only its current value. Thus clients are forced to guess by looking for another reference whose current SHA-1 is the same. If there is more than one, its taking a best guess.

There have been a few attempts to expand the protocol and include the current symbolic reference target name, but thus far it hasn't gotten much beyond the idea stage.

A patch has been proposed though (but only as a "a quick-and-dirty patch for local repositories").

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250