Deleted the stash that had all of the latest work (don't know why). I suspect it doesn't save on bitbucket as remote, thus how do I get it back on windows 10. I don't even have git installed to use fsck.
-
2Try the `reflog`. Hopefully you haven't done a `gc` command yet. This is for your local repo where the stash is on. – Dandré Jul 10 '16 at 10:17
-
That is for git cli or git kraken since I don't imagine installing git will help me any with what I did in git kraken, while git kraken doesn't appear to have command line: unless "gitkraken reflog" ? -nope – janat08 Jul 10 '16 at 11:19
1 Answers
I don't even have git installed to use fsck
I'm not familiar with GitKraken, but as far as I can tell, like most/all other git GUIs/clients GitKraken requires an installation of git. GitKraken isn't an alternative to git, it's a pretty wrapper around git designed to provide a beginner friendly interface. You probably installed git without knowing it when you installed GitKraken. Perhaps git isn't in your path, or you're confusing git fsck
with the linux fsck
command (which you won't have on windows).
If you've waited too long and let git remove the unreachable commit during garbage collection, you're out of luck. However, this usually takes a while (I think by default it will take at least 2 weeks) so that probably hasn't happened.
Regardless of why you believe you don't have git installed, it looks like GitKraken has a "Terminal Tab" where should be able to use the standard git cli commands. If you still have access to the commit hash of the dropped stash, you can apply it using git stash apply <hash>
, or re-insert it into the stash list using git stash store <hash>
.
If you don't have the commit hash, how you find it depends on what kind of terminal the "Terminal Tab" is showing you (batch, powershell, git-bash, etc.). I'm guessing it's probably a git-bash terminal, so you can probably follow the instructions in the git-stash docs. Alternatively, you can look at some of the answers to this question: How to recover a dropped stash in Git?. Those also include some answers for powershell.
In the worst case, where it's a batch terminal with git cli commands available, or it only accepts git commands, you can manually re-create the process described in the git-stash docs:
- copy-paste the output of
git fsck --unreachable
into a text editor or IDE that supports regex find&replace. - Remove lines that contain "tree" or "blob": Find
unreachable (tree|blob) .*\n
, replace with nothing/empty string, click replace all. - Convert to a space separated list of commit hashes: Find
unreachable commit (.*)\n
, replace with$1
, click replace all. - Copy the list of commit hashes, then in the GitKraken "Terminal Tab", type
git log --merges --no-walk --grep=WIP
then paste the list of commit hashes and run the command.

- 522
- 3
- 17