Created
December 9, 2020 10:57
-
-
Save Shipu/a601f100ab7d24883e345717be219d38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python 2 | |
# git fsck --full | |
import subprocess | |
hashes=["01b6a7f272375bc99d98be0068c273b5bc4e9ff6", | |
"03620d7b53c8a48314c25a3ecdbe369553b01340","PUTYOUR HASHEZ HERE"] | |
for myhash in hashes: | |
print "HASH", myhash | |
bashCommand = "git cat-file -p "+ myhash | |
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE) | |
output, error = process.communicate() | |
file = open("recover/"+myhash, "w") | |
file.write(output) | |
file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment