Skip to content

Instantly share code, notes, and snippets.

@henriquemenezes
Created October 22, 2018 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henriquemenezes/5e26fef1135b2001d2191d3780df825f to your computer and use it in GitHub Desktop.
Save henriquemenezes/5e26fef1135b2001d2191d3780df825f to your computer and use it in GitHub Desktop.
Git Mirror
#!/bin/bash
from_repo=$1
to_repo=$2
repo_dir=${from_repo##*/}
echo "Git Mirror: $from_repo -> $to_repo"
git clone --bare $from_repo
cd $repo_dir
git push --mirror $to_repo
cd ..
rm -rf $repo_dir
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment