1

I basically have two github private repositories in two different account and I want to set a provision in such way that when the code is pushed to first repository it should automatically available in (sync with) second repository created under different account.

I have referred https://github.com/makefu/repo-sync but didn't help.

Any one has steps to achieve this?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
mansing shinde
  • 445
  • 7
  • 25

1 Answers1

0

The fact that the mirror GitHub repo is under a different account does not matter, as long as your process has the right credentials (username/password).

If you are alone working on that repo, you can simply push to two different repos, as long as your git credential helper has both credentials memorized.

If you are not alone, and your remote repo can be updated (push) from multiple sources, you need to register a GitHub webhook, and setup a listener able to push events.
You can find an example in webhook.py mentioned in RalfJung/git-mirror.

The idea is to trigger a git fetch repo1 + git push --mirror repo2 in order to keep repo2 in sync with repo1.

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