Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bitsmuggler/8a1e5347cac3a34dcd9655813b546533 to your computer and use it in GitHub Desktop.
Save bitsmuggler/8a1e5347cac3a34dcd9655813b546533 to your computer and use it in GitHub Desktop.
git synch
# 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