Created
August 13, 2014 10:40
-
-
Save crater2150/a95a64bbc08d67413d47 to your computer and use it in GitHub Desktop.
Make a copy of a git repo with unpacked refs and objects
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
mkdir new_repo && cd new_repo | |
git init | |
git unpack-objects < /path/to/old/repo/.git/objects/pack/*.pack | |
git unpack-refs |
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
[alias] | |
unpack-refs = "!bash -c 'IFS=$''\\n''; for f in $(git show-ref --heads); do /bin/echo ''Writing '' $(echo $f | cut -c42-); echo $(echo $f | cut -c1-40) > \"${GIT_DIR:-.git}/$(echo $f | cut -c42-)\"; done'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment