<p>You can directly see <code>HEAD</code> if you look into the file <code>.git/HEAD</code>. What you find in there is all there is to it, there is nothing more.</p>

<p><code>HEAD</code> does not, strictly, point to the current branch but is the commit that is currently checked out. It is, by definition, the first entry that <code>git log</code> lists. </p>

<p>If you do a <code>git checkout branchname</code> then, yes, indeed, <code>.git/HEAD</code> will contain the <code>ref</code> of the branch you checked out, probably something like <code>refs/head/branchname</code>. This in turn is literally the file that contains the actual commit hash; you can see it in <code>.git/refs/head/branchname</code>. But if you do <code>git checkout commithash</code> then <code>.git/HEAD</code> will contain said hash, and you will be in a "headless" state (git will give you a longish message explaining what that is). In this case, there is no "current branch".</p>

CC BY-SA 3.0
2017-10-10T11:53:02.750Z
Hi thanks,  when we move file to staging area, one temp ref head id will create in local repository which stating current working commit(commiting by some one else).Not the head that showing in our current branch
Vinodh Machi
CC BY-SA 3.0
2017-10-10T08:03:12.693Z
2017-10-10T08:03:12.693Z
AnoE
<p>Not the current working HEAD REFERENCE which points in our current branch.</p>

<git>
How can I see HEAD temp pointer reference in Git?
Vinodh Machi
# How can I see HEAD temp pointer reference in Git?

(Asked by: username_0 on 2017-10-10)

Not the current working HEAD REFERENCE which points in our current branch.

**Tags:** git


---

## 1 answers

### Answer by username_1 on 2017-10-10. Score: 2 | Accepted answer

You can directly see `HEAD` if you look into the file `.git/HEAD`. What you find in there is all there is to it, there is nothing more.

`HEAD` does not, strictly, point to the current branch but is the commit that is currently checked out. It is, by definition, the first entry that `git log` lists.

If you do a `git checkout branchname` then, yes, indeed, `.git/HEAD` will contain the `ref` of the branch you checked out, probably something like `refs/head/branchname`. This in turn is literally the file that contains the actual commit hash; you can see it in `.git/refs/head/branchname`. But if you do `git checkout commithash` then `.git/HEAD` will contain said hash, and you will be in a "headless" state (git will give you a longish message explaining what that is). In this case, there is no "current branch".

> **Comments:**
> **username_0**: Hi thanks,  when we move file to staging area, one temp ref head id will create in local repository which stating current working commit(commiting by some one else).Not the head that showing in our current branch  

---

