Sunday, August 26, 2012

Sync 2 repo

ref:http://git.wikia.com/wiki/Sync_2_repo
http://git-scm.com/book/en/Git-Branching-Remote-Branches

From here We might have the interesting issue, that there is a central "internal" git server, but we want to automatically synchronize it to some other "external" repository as well.
  • Creating a local bare repository on the central "internal" git server

Look also at the end of the link above for a simpler solution:
git clone --mirror

You might want to add groups and permission stuff before
ssh @146.124.44.190
cd /pub/git
...
Another experiment:
Assume the "internal" git server is here:
/home/rber/projects/ICOM/qt/try-it-icom/internal-git-server
Assume the "external" git server is here:
git://reliable.indefero.net/reliable/
On the "internal" git server we'll checkout the "external" repository:
cd /home/rber/projects/ICOM/qt/try-it-icom/internal-git-server
git clone --bare git://reliable.indefero.net/reliable/qt-everywhere-scripts.git
We must now manually configure the remote branch tracking and then synchronize the repositories:
cd /home/rber/projects/ICOM/qt/try-it-icom/internal-git-server/qt-everywhere-scripts.git
git remote add origin git://reliable.indefero.net/reliable/qt-everywhere-scripts.git
git fetch -v

Automatically synchronize:
git fetch origin
git merge origin

No comments:

Post a Comment