Skip to content

Instantly share code, notes, and snippets.

View changusmc's full-sized avatar

David Chang changusmc

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