# Differences between git show HEAD and git show head

3 messages from 2018-09-17 to 2018-09-17. Participants: Nikola Milekic, Ævar Arnfjörð Bjarmason.
Thread: https://gitlist.dev/t/49357

## Nikola Milekic, 2018-09-17 11:22

Subject: Differences between git show HEAD and git show head
Message-ID: <CACU07Yt5vh36tHcHxV-b_5MNLc-RzqGQ7=nkJq-DTqNgmYP+wA@mail.gmail.com>
URL: https://gitlist.dev/e/CACU07Yt5vh36tHcHxV-b_5MNLc-RzqGQ7%3DnkJq-DTqNgmYP%2BwA%40mail.gmail.com

```
Hi,

On Windows, when using multiple workspaces and git 2.19.0.windows.1,
'git show HEAD' and 'git show head' return different results when
executed from a secondary workspace (the one without the .git
directory).

'git show HEAD' shows the HEAD of the current workspace, while git
show head shows the HEAD of the main workspace (the one with the .git
directory). I find this to be highly misleading, especially for users
like myself who are not used to typing HEAD in all caps. Is this
indented behavior or a bug?

Thanks.

Best regards,
Nikola

```

## Ævar Arnfjörð Bjarmason, 2018-09-17 13:23

Subject: Re: Differences between git show HEAD and git show head
Message-ID: <875zz4l0kv.fsf@evledraar.gmail.com>
URL: https://gitlist.dev/e/875zz4l0kv.fsf%40evledraar.gmail.com
In-Reply-To: <CACU07Yt5vh36tHcHxV-b_5MNLc-RzqGQ7=nkJq-DTqNgmYP+wA@mail.gmail.com>

```

On Mon, Sep 17 2018, Nikola Milekic wrote:

> Hi,
>
> On Windows, when using multiple workspaces and git 2.19.0.windows.1,
> 'git show HEAD' and 'git show head' return different results when
> executed from a secondary workspace (the one without the .git
> directory).
>
> 'git show HEAD' shows the HEAD of the current workspace, while git
> show head shows the HEAD of the main workspace (the one with the .git
> directory). I find this to be highly misleading, especially for users
> like myself who are not used to typing HEAD in all caps. Is this
> indented behavior or a bug?

This is an outstanding bug in git that's tricky to solve (maybe you're
interested!), here's a recent discussion about it:
https://public-inbox.org/git/87ziclb2pa.fsf@gmail.com/

```

## Nikola Milekic, 2018-09-17 13:33

Subject: Re: Differences between git show HEAD and git show head
Message-ID: <CACU07Yug+oiiKXa53W6f+mugLPdrXOHRRDbWVOpbwwKov4MiFA@mail.gmail.com>
URL: https://gitlist.dev/e/CACU07Yug%2BoiiKXa53W6f%2BmugLPdrXOHRRDbWVOpbwwKov4MiFA%40mail.gmail.com
In-Reply-To: <875zz4l0kv.fsf@evledraar.gmail.com>

```
Ups, my bad, didn't realize that. Apologies for spamming. Would love
to help but unfortunately I have no C background.
On Mon, Sep 17, 2018 at 3:23 PM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
>
> On Mon, Sep 17 2018, Nikola Milekic wrote:
>
> > Hi,
> >
> > On Windows, when using multiple workspaces and git 2.19.0.windows.1,
> > 'git show HEAD' and 'git show head' return different results when
> > executed from a secondary workspace (the one without the .git
> > directory).
> >
> > 'git show HEAD' shows the HEAD of the current workspace, while git
> > show head shows the HEAD of the main workspace (the one with the .git
> > directory). I find this to be highly misleading, especially for users
> > like myself who are not used to typing HEAD in all caps. Is this
> > indented behavior or a bug?
>
> This is an outstanding bug in git that's tricky to solve (maybe you're
> interested!), here's a recent discussion about it:
> https://public-inbox.org/git/87ziclb2pa.fsf@gmail.com/

```
