I have two repository urls, and I want to synchronise them such that they both contain the same thing. In Mercurial, what I\'m trying to do would be:
hg pull
Here's a tested solution for the issue: http://www.tikalk.com/devops/sync-remote-repositories/
The commands to run:
#!/bin/bash
# REPO_NAME=.git
# ORIGIN_URL=git@:/$REPO_NAME
# REPO1_URL=git@:/$REPO_NAME
rm -rf $REPO_NAME
git clone --bare $ORIGIN_URL
cd $REPO_NAME
git remote add --mirror=fetch repo1 $REPO1_URL
git fetch origin --tags ; git fetch repo1 --tags
git push origin --all ; git push origin --tags
git push repo1 --all ; git push repo1 --tags