I just had this same issue with GitKraken. It would keep presenting this "compatible repository" message even though it would load the repo and let me stage and browse commits. However, after about a minute, it would unload the repo and start trying to load it again, but just hang trying to load. Other tools (Giggle, gitg
, git-gui, and the git
CLI) all seemed to work just fine.
A Solution
Digging a little deeper I found that, apparently, something got corrupted in my reflog. You can inspect the files in .git/logs/refs/heads/*
and .git/logs/refs/remotes/*/*
for any lines that look extremely unusual. All of the lines should look very much the same (from-hash, to-hash, timestamp, user, message, and so on). The corrupted lines in my log had loads of strange symbols and were like 4 time the length of the other lines. Very obvious.
I also found some zero byte objects, which should not be. Those are temp files that should have been filled with data or deleted but were not, for... reasons. They can safely be deleted.
find .git/objects -size 0 -type f -delete
The Nuclear Option
To get my GitKraken working again, I need to go with the Nuclear Option.
Ok, if you are still having trouble and are CERTAIN that you do not need anything in your reflog, INCLUDING YOUR STASH, you can expire all of it now and clean up (garbage collect) the dangling refs:
git reflog expire --expire=now --all
git gc --prune=now
Well, I guess that there is an even more extreme step, in that you could delete the repo and re-clone but you would lose all local branches, stashes, and unpushed commits. I wasn't okay with that.