Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

warning: ignoring ref with broken name refs/stash 2

Tags:

git

I see that there are other issues covering this topic but it also seems rather sensitive. I don't want to delete any data so I want to make sure that I fix this the correct way. I'm getting this error when ever I try to autocomplete anything with git.

ERROR:

warning: ignoring ref with broken name refs/stash 2

Does anybody know what is going wrong here and how I can fix it? Thank you!

like image 963
Bitwise Avatar asked Jan 28 '23 05:01

Bitwise


1 Answers

What's not clear to me is what created these incorrect / broken reference names.

To fix it, you can delete them:

git update-ref -d 'refs/stash 2'

However, note that whatever made them might be expecting them to be useful (they're not) and to protect various internal Git objects (they may not, because some parts of Git reject them as invalid).

They are in fact invalid; see the git check-ref-format documentation for details. The git update-ref command refuses to create the bad references, so (again) it's not clear what made them. (Probably evil software that writes directly into .git.)

like image 188
torek Avatar answered Feb 07 '23 10:02

torek