views:

93

answers:

1

I'm new to Git, so I suspect that I'm misunderstanding something here, but I'll ask anyway.

Via TortoiseGit I do the following:

  • Init a new Git repo locally
  • Add a readme file to it and commit
  • Add a new remote
  • Push the new repo to the orgin (remote)

If I then Browse Refs I see the following:
heads/master
remotes/origin/master

What I find odd is that I don't see a HEAD on the remotes.

If I delete my local repo and then clone it from the server (I just pushed to above) and then browse the refs I see:
heads/master
remotes/origin/HEAD
remotes/origin/master

So why don't I see a remote head after the initial push?

NB. I've done the same via Git Bash command (ie. not Tortoise Git) and am seeing the same thing.

A: 

It's because you don't pull your repository. When you push you update the ref remote/origin/master, but not HEAD because it can be to other commit. If you pull after the HEAD arrive.

It's coming with your clone after. Fetch all refs from remote like HEAD and master

shingara
I'm not totally sure I understand - are you saying that after I've done the initial push to the remote, if I then do a Pull and/or Fetch I should get the HEAD? Because I've tried that and I don't.
dwynne