Skip to content

Instantly share code, notes, and snippets.

@georgeyord
Created September 28, 2020 07:42
Show Gist options
  • Save georgeyord/b47c59da232938f94af76f02e393a9ce to your computer and use it in GitHub Desktop.
Save georgeyord/b47c59da232938f94af76f02e393a9ce to your computer and use it in GitHub Desktop.
Mirror git repo to different repo
#!/usr/bin/env bash
# Create a teml working dir
mkdir -p /tmp/repo-move
cd /tmp/repo-move
# Clone the original repo
git clone --bare [ORIGINAL_REPO]
# Push to target repo
git push --mirror [TARGET_REPO]
# Do some joanitor work
#[ORIGINAL_REPO]: Archive
#[TARGET_REPO]: Branch protection + Acess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment