Git子树帖子挂钩 [英] Git subtree post hook

查看:171
本文介绍了Git子树帖子挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够自动更新子树。我有一个只包含来自第三方回购的子树的回购,并且希望每当主回购被拉时使用post挂钩来更新这些回收。 方案

正如担心的那样,在开发更大的项目时,依赖库保持稳定通常很重要。如果您经常自动提取这些更改,您将无法确认它们没有针对您的父项目进行重大更改。



如果您打算要做钩子脚本,我建议你只抓取但不要拉。



Fetch会更新本地远程副本,但不会将您的工作分支更新为
$ b >至于如何实现一个钩子脚本



是一对夫妇的出发点:




I would like to be able to update subtrees automatically. I have one repo that consists solely of subtrees from third-party repos, and would like to use a post hook to update these whenever the main repo is pulled.

解决方案

Just as a concern, in development of larger projects it's often important for dependent libraries to remain stable. If you constantly pull the changes automatically you don't have the opportunity to confirm that they don't come with breaking changes for your parent project.

If you're going to do the hook script, I recommend you only fetch but do not pull.

Fetch will update the local copy of the remote, but won't update your working branch to the head.

As for how to implement a hook script:

Here are a couple starting points:

这篇关于Git子树帖子挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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