Skip to content

Instantly share code, notes, and snippets.

Avatar

David Chang changusmc

View GitHub Profile
@changusmc
changusmc / gist:8c72c748b193f0ad6f4d2cb932d38043
Created Apr 20, 2022
Creates a new repo fast by creating a local mirror
View gist:8c72c748b193f0ad6f4d2cb932d38043
# 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