Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
find . -type f -empty -delete
git fsck --full
git gc --aggressive --prune=now
# Dealing with bad ref head
tail .git/logs/HEAD # from
git update-ref HEAD <hash> # from
When a rebase is stuck, go to a known point and:
`rm -rf .git/rebase-merge`
For git file is empty loose object corrupt
find .git/objects/ -size 0 -exec rm -f {} \;
git fetch origin
# git pull fails 'error: refs/stash does not point to a valid object!'
rm .git/refs/stash .git/logs/refs/stash
git stash

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment