Git subtree post hook

随声附和 提交于 2019-12-11 02:49:22

问题


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.


回答1:


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:

  • http://git-scm.com/book/en/Customizing-Git-Git-Hooks
  • http://githooks.com/


来源:https://stackoverflow.com/questions/22182059/git-subtree-post-hook

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