# Ambiguous 'HEAD' issue.

7 messages from 2022-08-27 to 2022-09-08. Participants: Caglar Akyuz, Felipe Contreras, Junio C Hamano, Jeff King, Johannes Sixt.
Thread: https://gitlist.dev/t/58371

## Caglar Akyuz, 2022-08-27 20:42

Subject: Ambiguous 'HEAD' issue.
Message-ID: <AM0PR08MB4323160241D4341FB1B99CC2FD749@AM0PR08MB4323.eurprd08.prod.outlook.com>
URL: https://gitlist.dev/e/AM0PR08MB4323160241D4341FB1B99CC2FD749%40AM0PR08MB4323.eurprd08.prod.outlook.com

```
Hello,

Recently I changed one of my repo's origin URL from gitlab to github.  After this switch, I start getting:

  warning: refname 'HEAD' is ambiguous.

messages when I use 'git status'. I check various things if I have tags/branches to blame but cannot find anything:

* git show-ref | grep -i head -> nothing suspicious

* find . -name HEAD | grep -v modules -> only .git/logs/HEAD and .git/HEAD

* git branch -a | grep HEAD -> nothing

Do you have any suggestions for a possible fix to this?

Thanks,
Caglar


```

## Felipe Contreras, 2022-08-28 01:00

Subject: Re: Ambiguous 'HEAD' issue.
Message-ID: <CAMP44s2iwWhpeBrzuRK5mB9ekpy4MRu5OEQ-BA4mvbUb1EJRqw@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s2iwWhpeBrzuRK5mB9ekpy4MRu5OEQ-BA4mvbUb1EJRqw%40mail.gmail.com
In-Reply-To: <AM0PR08MB4323160241D4341FB1B99CC2FD749@AM0PR08MB4323.eurprd08.prod.outlook.com>

```
On Sat, Aug 27, 2022 at 5:15 PM Caglar Akyuz
<caglar.akyuz@sparsetechnology.com> wrote:

> Recently I changed one of my repo's origin URL from gitlab to github.  After this switch, I start getting:
>
>   warning: refname 'HEAD' is ambiguous.

> * git show-ref | grep -i head -> nothing suspicious

Are you sure? You don't have a ref called "HEAD"? Just "HEAD".

-- 
Felipe Contreras

```

## Caglar Akyuz, 2022-08-28 08:31

Subject: Re: Ambiguous 'HEAD' issue.
Message-ID: <AM0PR08MB4323EAC9ED1F88D5FF680DEFFD779@AM0PR08MB4323.eurprd08.prod.outlook.com>
URL: https://gitlist.dev/e/AM0PR08MB4323EAC9ED1F88D5FF680DEFFD779%40AM0PR08MB4323.eurprd08.prod.outlook.com
In-Reply-To: <CAMP44s2iwWhpeBrzuRK5mB9ekpy4MRu5OEQ-BA4mvbUb1EJRqw@mail.gmail.com>

```



From: Felipe Contreras <felipe.contreras@gmail.com>
Sent: Sunday, August 28, 2022 4:00 AM
To: Caglar Akyuz <caglar.akyuz@sparsetechnology.com>
Cc: git@vger.kernel.org <git@vger.kernel.org>
Subject: Re: Ambiguous 'HEAD' issue. 
 
On Sat, Aug 27, 2022 at 5:15 PM Caglar Akyuz
<caglar.akyuz@sparsetechnology.com> wrote:

>> Recently I changed one of my repo's origin URL from gitlab to github.  After this switch, I start getting:
>>
>>   warning: refname 'HEAD' is ambiguous.

>> * git show-ref | grep -i head -> nothing suspicious

> Are you sure? You don't have a ref called "HEAD"? Just "HEAD".

I don't see just "HEAD".  "git show-ref | grep HEAD" doesn't show anything if that's what you mean.

Thanks,
Caglar
```

## Junio C Hamano, 2022-08-29 06:36

Subject: Re: Ambiguous 'HEAD' issue.
Message-ID: <xmqqsflfr1y0.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqsflfr1y0.fsf%40gitster.g
In-Reply-To: <AM0PR08MB4323160241D4341FB1B99CC2FD749@AM0PR08MB4323.eurprd08.prod.outlook.com>

```
Caglar Akyuz <caglar.akyuz@sparsetechnology.com> writes:

> * find . -name HEAD | grep -v modules -> only .git/logs/HEAD and .git/HEAD

plus "grep HEAD .git/packed-refs"

> * git branch -a | grep HEAD -> nothing

plus "git for-each-ref | grep HEAD"


```

## Caglar Akyuz, 2022-08-29 06:57

Subject: Re: Ambiguous 'HEAD' issue.
Message-ID: <AM0PR08MB432341F2A27E1133C7A31DEBFD769@AM0PR08MB4323.eurprd08.prod.outlook.com>
URL: https://gitlist.dev/e/AM0PR08MB432341F2A27E1133C7A31DEBFD769%40AM0PR08MB4323.eurprd08.prod.outlook.com
In-Reply-To: <xmqqsflfr1y0.fsf@gitster.g>

```



From: Junio C Hamano <jch2355@gmail.com> on behalf of Junio C Hamano <gitster@pobox.com>
Sent: Monday, August 29, 2022 9:36 AM
To: Caglar Akyuz <caglar.akyuz@sparsetechnology.com>
Cc: git@vger.kernel.org <git@vger.kernel.org>
Subject: Re: Ambiguous 'HEAD' issue. 
 
>Caglar Akyuz <caglar.akyuz@sparsetechnology.com> writes:

>> * find . -name HEAD | grep -v modules -> only .git/logs/HEAD and .git/HEAD

>plus "grep HEAD .git/packed-refs"

This is empty as well.

>> * git branch -a | grep HEAD -> nothing

>>plus "git for-each-ref | grep HEAD"

This is empty output also.

Both 'grep HEAD .git/packed-refs' and 'git for-each-ref | grep HEAD'  commands return nothing and still 'git status' is complaining about ambiguous HEAD.

Thanks,
Caglar

```

## Jeff King, 2022-09-08 01:34

Subject: Re: Ambiguous 'HEAD' issue.
Message-ID: <YxlGnkPBmczarL62@coredump.intra.peff.net>
URL: https://gitlist.dev/e/YxlGnkPBmczarL62%40coredump.intra.peff.net
In-Reply-To: <AM0PR08MB432341F2A27E1133C7A31DEBFD769@AM0PR08MB4323.eurprd08.prod.outlook.com>

```
On Mon, Aug 29, 2022 at 06:57:00AM +0000, Caglar Akyuz wrote:

> Both 'grep HEAD .git/packed-refs' and 'git for-each-ref | grep HEAD'
> commands return nothing and still 'git status' is complaining about
> ambiguous HEAD.

Is it possible for you to tar up your .git directory and share it
(either publicly, or privately to individual developers)?

-Peff

```

## Johannes Sixt, 2022-09-08 06:27

Subject: Re: Ambiguous 'HEAD' issue.
Message-ID: <e6cfc04b-8f53-fb81-ea8b-79e983e46201@kdbg.org>
URL: https://gitlist.dev/e/e6cfc04b-8f53-fb81-ea8b-79e983e46201%40kdbg.org
In-Reply-To: <AM0PR08MB432341F2A27E1133C7A31DEBFD769@AM0PR08MB4323.eurprd08.prod.outlook.com>

```
Am 29.08.22 um 08:57 schrieb Caglar Akyuz:
> Both 'grep HEAD .git/packed-refs' and 'git for-each-ref | grep HEAD'
> commands return nothing and still 'git status' is complaining about
> ambiguous HEAD.
Are you on a case-insensitive filesystem? Does `find .git -iname head
-print` report anything that is not named uppercase HEAD?

-- Hannes

```
