How to keep 2 git repositories in sync automatically

核能气质少年 提交于 2019-12-02 04:54:01

问题


Having 2 servers which should be in sync with eachothers at all times.

As someone pushes something to the repository of server A, the repository on server B should be updated automatically, depending what server is the master/slave.

Both servers are not on the same machine.

Is this possible without having to run additional manual commands every update? (git fetch etc.) Or do you advise a different mechanism?


回答1:


You could use a post-receive or update Git Hook to push between repositories.



来源:https://stackoverflow.com/questions/17596503/how-to-keep-2-git-repositories-in-sync-automatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!