i use git diff --cached command then i got warning: refname 'HEAD' is ambiguous.
now if i used git branch i am getting Error like that
error: refs/description points nowhere!
error: refs/index points nowhere!
error: refs/packed-r开发者_StackOverflow中文版efs points nowhere!
error: refs/config points nowhere!
205010_v2
Looks like the top-level files in your .git
directory (or another .git
directory) were somehow copied to .git/refs
.
The ambiguous ref name warning is probably because there is both .git/HEAD
and .git/refs/HEAD
. If both files exist, the name HEAD
could refer to either file, hence the warning. It's a warning and not an error because Git will always choose .git/HEAD
over .git/refs/HEAD
. See git help revisions
for documentation on how Git resolves reference names.
The "points nowhere" errors are from non-reference files in the .git/refs
directory.
To fix, delete the following files after backing them up:
.git/refs/HEAD
.git/refs/description
.git/refs/index
.git/refs/packed-refs
.git/refs/config
精彩评论