推送到主节点时如何自动推送到子树?

时间:2020-04-13 08:50:40

标签: git github

当我推送到主树时,如何自动推送到子树?我当前的工作流程是在按下主菜单后执行以下命令:

git subtree push --prefix dist origin branch

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

您应该能够使用Git Hook做到这一点。大概是post-receive

Git挂钩: https://git-scm.com/docs/githooks#post-receive

看起来这里的脚本非常接近您的需求。 Git: is there a way to auto push a subtree?