Last active
June 14, 2020 22:26
-
-
Save nachoalonso/e511dbcabbe8e9b1ba7b26dc2b0626ac 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
# The following command removes git-fat (https://github.com/jedbrown/git-fat) | |
# from a Git repository. | |
# | |
# Requires Python 3 and git-filter-repo (https://github.com/newren/git-filter-repo) | |
# | |
# Note that this rewrites the history of the Git repository and forces everyone | |
# to clone again | |
# Steps: Get a new clean copy of the Git repository and then run | |
cd {git_repository} | |
git filter-repo --blob-callback " | |
import os | |
GIT_FAT_HEADER = b'#\$# git-fat' | |
print('.', end='') | |
if (blob.data.startswith(GIT_FAT_HEADER)): | |
object_id = blob.data.decode()[12:52] | |
fat_file_path = os.path.join('{full_path_to_fatstore}', object_id) | |
with open(fat_file_path, 'rb') as file: | |
blob.data = file.read()" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment