git钩子更新工作目录和裸git目录的变化 [英] git hook to update changes to working directory and bare git directory

查看:125
本文介绍了git钩子更新工作目录和裸git目录的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何将更改克隆并推送(写入)到生产服务器上的裸存储库。



但是这些更改如何反映在生产工作目录中?

我使用了其他SCLM多年,在那些您从生产服务器检出文件并将更改直接推送到生产服务器的文件中。

git可以执行类似的自动部署功能吗?如果是这样如何?

解决方案

Git没有任何内置的功能,但提供了挂钩来插入这种类型的功能。 git post-receive hook将适合您的用例:



https://help.github.com/articles/post-receive-hooks



此链接也可能提供更多有用的信息和特定于您的问题的脚本: http://toroid.org/ams/git-website- howto


I know how to clone and push (write) changes to a bare repository on a production server.

But how are these changes reflected in the production working directory?

I have used other SCLM for years, in those you checked the file out from production server and pushed your changes directly to the production server.

Can git perform a similar "auto-deploy" functionality? If so how?

解决方案

Git does not have any built-in functionality for this, but does provide hooks to plug in this type of functionality. A git post-receive hook will be appropriate for your use case:

https://help.github.com/articles/post-receive-hooks

This link may also provide more useful information and scripts specific to your question: http://toroid.org/ams/git-website-howto.

这篇关于git钩子更新工作目录和裸git目录的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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