I have read the similar Question Git error: refname 'HEAD' is ambiguous and tried all the answers but in my case those do not help, since the reason for the message in the usual case is a local branch or tag named HEAD. I found this message to appear even when no HEAD or head branch is within the workspace.
I'm facing the following issue, after each interaction with git I get the warning:
$git status
warning: refname 'HEAD' is ambiguous.
warning: refname 'HEAD' is ambiguous.
warning: refname 'HEAD' is ambiguous.
Auf Branch main
Ihr Branch ist auf demselben Stand wie 'origin/main'.
nichts zu committen, Arbeitsverzeichnis unverändert
No I checked all my local and remote branch and tag names and also did the prune thing:
git fetch --prune
but still, no luck. The message has popped up a few weeks after hosting an other git repo within my parent multi repo but with its own forked head, so this might have somehow trigger the issue. I moved the repo out but the error is still there. Any suggestions?
PS I do not have a branch called head:
git show-ref
84dac8551de99be283025395338935cd9583c707 refs/heads/Resoner-provierder-as-singleton-hook-experiments
4350427f8397f7c12c16c3f38a15a14cddf2061a refs/heads/add-RNTet
f00d5c15743cabf3fe2b41e68b71c0278e9d8e3a refs/heads/bring_OCR_back
a15789e8f93a23f8a6ec5436608a6c1a0001713d refs/heads/local
6818867b2be03fdb3b606a6e910ef5093e5b81c5 refs/heads/locale
20cdee211a6ad0d8346d3bc445ee7073fb0b03fc refs/heads/main
a4cb53d8fccc568b00283d8daa9b55d2b1fce35f refs/heads/refactoring-of-getStatements
ea8d2b94c2b36932dfdc1ccffd9e5d990546e4c5 refs/heads/refactoring-of-getStatements-mergebranch
572750357cfe3f73633f5c7bf4545857ba1c24ea refs/heads/reproducing_the_tesseract_issue_in_the_simulator
84dac8551de99be283025395338935cd9583c707 refs/remotes/origin/Resoner-provierder-as-singleton-hook-experiments
4350427f8397f7c12c16c3f38a15a14cddf2061a refs/remotes/origin/add-RNTet
f00d5c15743cabf3fe2b41e68b71c0278e9d8e3a refs/remotes/origin/bring_OCR_back
6818867b2be03fdb3b606a6e910ef5093e5b81c5 refs/remotes/origin/locale
20cdee211a6ad0d8346d3bc445ee7073fb0b03fc refs/remotes/origin/main
a4cb53d8fccc568b00283d8daa9b55d2b1fce35f refs/remotes/origin/refactoring-of-getStatements
ea8d2b94c2b36932dfdc1ccffd9e5d990546e4c5 refs/remotes/origin/refactoring-of-getStatements-mergebranch
572750357cfe3f73633f5c7bf4545857ba1c24ea refs/remotes/origin/reproducing_the_tesseract_issue_in_the_simulator
22e504f1143c43b38ad058931fae8599f4e09305 refs/stash
61880f86be6a3d6624b32ce2a5dbc75b7a1d4d5c refs/tags/mileston/1
PPS (no HEAD head situation) the .git folder looks good as well:
➜ .git git:(main) ll
total 80
-rw-r--r-- 1 mac staff 51B 19 Feb 23:59 COMMIT_EDITMSG
-rw-r--r-- 1 mac staff 85B 20 Feb 00:07 FETCH_HEAD
-rw-r--r-- 1 mac staff 21B 19 Feb 18:06 HEAD
-rw-r--r-- 1 mac staff 41B 20 Feb 00:07 ORIG_HEAD
-rw-r--r-- 1 mac staff 1,0K 19 Feb 23:57 config
drwxr-xr-x 3 mac staff 96B 27 Sep 22:16 hooks
-rw-r--r-- 1 mac staff 19K 19 Feb 23:59 index
drwxr-xr-x 4 mac staff 128B 27 Sep 23:01 logs
drwxr-xr-x 260 mac staff 8,1K 20 Feb 00:07 objects
drwxr-xr-x 6 mac staff 192B 20 Feb 16:02 refs
drwxr-xr-x 16 mac staff 512B 21 Jan 12:19 rr-cache
PPPS (.gitmodules)
➜ fak10 git:(main) find . -name ".gitmodules"
./node_modules/extsprintf/.gitmodules
./node_modules/verror/node_modules/extsprintf/.gitmodules
./packages/app/node_modules/art/.gitmodules
./packages/app/node_modules/art/lib/slick/.gitmodules
./packages/app/node_modules/extsprintf/.gitmodules
./packages/app/node_modules/verror/node_modules/extsprintf/.gitmodules
./packages/app/node_modules/realm/vendor/realm-core/.gitmodules
./packages/app/node_modules/realm/src/object-store/.gitmodules
PPPS (workaround)
Its actually quite easy to get rid of the problem by deleting local copy and cloning the repo once again, but it would be good to get behind the issue in order to batter understand it.