Created
April 20, 2022 15:47
-
-
Save changusmc/8c72c748b193f0ad6f4d2cb932d38043 to your computer and use it in GitHub Desktop.
Creates a new repo fast by creating a local mirror
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
# Create a mirror from your existing source directory | |
git clone -v --mirror $HOME/dev/source_repo $HOME/dev/source_repo_mirror | |
# Updating existing repository mirror to find commit HEAD | |
git --git-dir $HOME/dev/source_repo_mirror remote set-url origin $REMOTE_URL | |
git --git-dir $HOME/dev/source_repo_mirror fetch origin main | |
# Create your new copy | |
git clone -v --reference ~/dev/source_repo_mirror -- $REMOTE_URL source_repo2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment