Created
October 22, 2018 13:46
-
-
Save henriquemenezes/5e26fef1135b2001d2191d3780df825f to your computer and use it in GitHub Desktop.
Git Mirror
This file contains hidden or 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
#!/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