GIT支持SVN这样的主/从概念吗? [英] Does GIT support master/slave concept like SVN?

查看:129
本文介绍了GIT支持SVN这样的主/从概念吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



是否可以在GIT中设置主从设置。在位置A(服务器A)说所有提交活动正在发生,并且它必须被推送到将充当主人的位置B.同步b / n A到B可以每晚进行。它像我们不使用我们的主@位置B提交,拉等由于带宽限制。所有的版本控制活动必须从位置A只要。是否有可能,如果是的话,怎么样?

在此先感谢。

我认为你可以通过post-githook(一个在发生推送后由远程服务器上的git触发的脚本)轻松实现这一点。



http://git-scm.com/docs/githooks#post-receive

p>

https: //git-scm.com/book/en/v2/Customizing-Git-Git-Hooks


I'm quite new to GIT and still learning concepts so kindly bear with me.

Is it possible to setup master-slave setup in GIT . Say at location A(server A) all the commit activities are happening and it has to be pushed to location B which will act as a master. Sync b/n A to B can happen nightly.

Its like we don't to use our master @ location B to commit , pull etc due to bandwidth restriction .All the version control activities has to be done from location A only. IS it possible, if so how ??

Thanks in advance.

解决方案

I think you can achieve this easily with a post-receive githook (a script that gets triggered by git on the remote server after a push happens)

http://git-scm.com/docs/githooks#post-receive

https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

这篇关于GIT支持SVN这样的主/从概念吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆