Last active
December 11, 2022 18:18
-
-
Save andrader/08bedf4641c4b80bec6d901954317d25 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# first argument is repository to duplicate, second is a new empty repository | |
# `duplicate_repo.sh ARG1 ARG2` | |
# or | |
# `curl GIST_RAWURL | bash -s ARG1 ARG2` | |
SOURC="$1" && \ | |
DEST="$2" && \ | |
echo $SOURC $destrepo && \ | |
git clone --bare $SOURC tmprepo && \ | |
cd tmprepo && \ | |
git push --mirror $DEST && \ | |
cd .. && \ | |
rm -rf tmprepo && \ | |
git clone $DEST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment