Add git-recover to recover from corrupt Git files

This commit is contained in:
2019-09-02 22:03:07 +02:00
parent 1363d9af51
commit 6ae2696c16

View File

@@ -155,6 +155,15 @@ function git-remaster() {
fi
}
function git-recover() {
echo 'This operation is destructive. Ctrl-C now.'
read
find .git/objects/ -size 0 -exec rm -f {} \;
git fetch origin
echo 'You may need to run:'
echo 'git symbolic-ref HEAD refs/heads/mybranch'
}
function ds() {
du -sh "$@" | sort -rh
}