I have a script that uses git write-tree
to make up for the deficiencies in git stash
, it works perfect unless I ctrlC the script.
[... other parts of script ...]
exec('git add -f .');
workingTreeHash=exec('git write-tree');
exec('git checkout -f [...]');
At this point the I ^C the script and thus lost the write-tree hash variable workingTreeHash
.
My attempt at recovery:
$ git fsck --lost-found --full --unreachable
$ git config gc.auto 0
$ (
for i in $(ls .git/lost-found/{commit,other}/*);do
git show $(basename $i);
done;
)
|grep -iae 'unique modifications';
showed nothing... so where did the lost git add -f .;git write-tree
object go? Where can it be found. (I am aware of git workspaces, I will try that as an alternative for the script).
This isn't a high priority, just for future reference in case this happens again with something important.