I've got a broken stash:
% git stash drop
fatal: log for refs/stash is empty
% cat .git/logs/refs/stash
%
It does show up in git log --all
, though:
% lal
* f32cdce - (HEAD -> develop, origin/develop) (44 minutes ago) <Williams, Ken>
|\
| * 05cc7d3 - (3 weeks ago) <Ken Williams>
| * 6d9c8ae - (3 weeks ago) <Ken Williams>
| | * 3fb311d - (refs/stash) (3 weeks ago) <Ken Williams>
| |/|
| | * 19be16e - (3 weeks ago) <Ken Williams>
| |/
| * ffea5e2 - (i2) (9 weeks ago) <Ken Williams>
(lal
is my alias for git log --graph --pretty=format:'%h -%C(yellow)%d%Creset %Cgreen(%ad) %C(bold blue)<%an>%Creset' --all
.)
I did a git stash apply 3fb311d
, so I've got the content of the stash secured. Now, how can I remove that refs/stash
from the tree so it doesn't keep complaining?
EDIT
Even after deleting the refs/stash
reference as suggested by @mark-adelsberger, the commits show up in the history listing:
% lal
* f32cdce - (HEAD -> develop, origin/develop) (31 hours ago) <Williams, Ken>
|\
| * 05cc7d3 - (3 weeks ago) <Ken Williams>
| * 6d9c8ae - (3 weeks ago) <Ken Williams>
| | * 3fb311d - (3 weeks ago) <Ken Williams>
| |/|
| | * 19be16e - (3 weeks ago) <Ken Williams>
| |/
| * ffea5e2 - (i2) (9 weeks ago) <Ken Williams>
| * 199af47 - (9 weeks ago) <Ken Williams>
...
This is using Git 2.29.0 (homebrew) on OS X 10.15.7.