2

What would be the best way of synchronizing two repos(one being a mirror) and keep it updated

Orignal step

$ git clone --mirror git@example.com/ori.git
$ cd upstream-repository.git
$ git push --mirror git@example.com/new-location.git

Based on Cronjob

$ cd upstream-repository.git
$ git remote update
$ git push --mirror git@example.com/new-location.git

Does it make sense ?

Djanux
  • 301
  • 1
  • 4
  • 10

1 Answers1

0

Does it make sense ?

It depends on your remote server.
If you are pushing to the same git repo server, you could have a local backup repo with a regular pull from another local repo of that server.

Regarding your git remote update, see "Check if pull needed in Git": you can check if you have received any commit at all; if not, not need to push.

If you are pushing to another server which might not be listening for git queries, then you would use git bundle, which means transferring only one file (as I mentioned here)

.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250