1

When I do 'git branch', I get

* (no branch)

and when I do 'git remote', I get

test-mirror
test-dev
test-git

But I don't see how which of my local branch is tracking which remote branches?

I think it must have some mapping between my local branch with remote branch. Otherwise, I don't get anything when I do 'git pull'. But I have done 'git pull', I do see new changes. How can I see the mapping between my local branch and remote branch?

Thank you.

michael
  • 106,540
  • 116
  • 246
  • 346

1 Answers1

3

At the moment you are not on any branch, so it can't be tracking anything;-) This is also called a detached head.

It means that you checked out a specific commit, rather than the tip of a branch, and as commits are immutable (fixed sha1) git won't be able to update it.

If it was at the tip of a branch you would get a new commit linked to the previous tip of the branch.

as 'nobody' commented/linked - use git branch -vv # doubly verbose!

Philip Oakley
  • 13,333
  • 9
  • 48
  • 71
  • Thank you for your answer. But why when I do a 'repo sync' (a wrapper script from google for android project), why the value 'git branch -vv' changes? e.g. $ git branch -vv * (no branch) 2653621 – michael Oct 25 '12 at 03:33
  • I've not used that, but google suggested http://source.android.com/source/using-repo.html and a number of stack overflow comments. – Philip Oakley Oct 25 '12 at 07:14