Created
December 6, 2018 01:28
-
-
Save henriquemenezes/340a79bd92062c841afe59bffab52cfc 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