threads / discuss / 29435

HEAD file location

Subject: HEAD file location

## tl;dr

2 messages between Jan 24, 2012 and Jan 24, 2012.

replies: 1people: 2as markdown or json

mfine· Jan 24, 2012, 03:42 UTC · lore
I'm working on a Git project and had a question about HEAD.  
In our remote Git repository, I see the file
git_repo_home/HEAD
and another file 
git_repo_home/refs/heads/HEAD

The content of the former file is refs/heads/master which looks ok because we want HEAD pointing at master.

However, should the latter file exist? I had thought only branches should exist in /refs/heads and HEAD isn't a branch right? I'm wondering if we erroneously created a HEAD branch.

Thanks for any help!  
Sitaram Chamarty· Jan 24, 2012, 03:52 UTC · re: mfine · lore

Re: HEAD file location

On Tue, Jan 24, 2012 at 9:12 AM, mfine <eboats@gmail.com> wrote:
Show 16 quoted lines
> I'm working on a Git project and had a question about HEAD.
>
> In our remote Git repository, I see the file
>
> git_repo_home/HEAD
>
> and another file
>
> git_repo_home/refs/heads/HEAD
>
> The content of the former file is  refs/heads/master  which looks ok because
> we want HEAD pointing at master.
>
> However, should the latter file exist?  I had thought only branches
> should exist in /refs/heads and HEAD isn't a branch right?  I'm wondering
> if we erroneously created a HEAD branch.
Yes.  Someone did something like 'git push origin HEAD:HEAD'

← back to recent threads