0

I have two different repositories. 1. Primary repo 2. Secondary repo. I want to keep both repositories in sync. When I commit in primary repo, I want the commit to be reflected in secondary repository as well. Is it possible to achieve this automatically? I found manual steps but want it to be automated.

  • May we ask why you have two repositories? It would probably be difficult to guarantee that they are always in sync. – Tim Biegeleisen Nov 26 '18 at 07:22
  • I believe that you could consider it as normal git use case - when there is one repository on the server, and multiple locals, isn't it? When multiple developers push to remote repo, there is no problem to pull changes to local. So just create scripts, which will check if remote repository has later commits than local - and execute pull from remote repository. In case, if you'd like to have both as remote repositories, then the 2nd repo could be done as fork from 1st repository. Such services as github, etc. allow easily synch forked repository with main one. – kosist Nov 26 '18 at 08:12
  • You can also use [`git pushall` alias](https://stackoverflow.com/a/47831008/7976758). – phd Nov 26 '18 at 12:32
  • https://stackoverflow.com/search?q=%5Bgit%5D+push+two+repositories+automatically – phd Nov 26 '18 at 12:32
  • @TimBiegeleisen one is primary and another is secondary repo – Sandeep Thaker Nov 27 '18 at 11:21

0 Answers0