Created
April 7, 2016 06:35
-
-
Save bitsmuggler/8a1e5347cac3a34dcd9655813b546533 to your computer and use it in GitHub Desktop.
git synch
This file contains 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
# Clear the folder first - please use this carefully | |
rm -rf $REPO_NAME | |
# clone the reposotory | |
git clone --bare $ORIGIN_URL | |
# add a remote repository | |
cd $REPO_NAME | |
git remote add --mirror=fetch repo1 $REPO1_URL | |
# update the local copy from the first repository | |
git fetch origin --tags | |
# update the local copy with the second repository | |
git fetch repo1 --tags | |
# sync back the 2 repositories | |
git push origin --all | |
git push origin --tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment