Git:推送到远程存储库时更新网站? [英] Git: updating website when pushing to remote repository?

查看:125
本文介绍了Git:推送到远程存储库时更新网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,当我推送到远程存储库时,我想更新它。

现在,我完成了以下工作:


  • 在包含网站的本地计算机上安装Git存储库。

  • 将(裸)存储库克隆到我的web服务器。 b $ b


现在我有点卡住了。我可以将更改推送到服务器上的裸存储库,但我不知道如何在我的www目录中检出存储库的工作副本,并在将本地存储库推送到服务器时自动更新它。我可能需要一个钩子脚本吗?



相关问题,使用Git部署PHP 部分回答了我的问题,但我想知道脚本实际上在做什么。

解决方案

这适用于我,它可能适用于您:
以网络为中心的Git工作流程


I have a website that I'd like to update whenever I push to a remote repository. I am coming from a svn background and still trying to figure out git.

Right now, I have done the following:

  • Setup a Git repository on my local machine containing the website.
  • Cloned the (bare) repository to my web server.

Now I'm a bit stuck. I can push the changes to my bare repository on the server but I have no idea of how to checkout a working copy of the repository in my www directory and automatically update it whenever I push my local repository to the server. I'll probably need a hook script right?

Related question, Deploy PHP using Git, partially answers my question, but I'd like to know what the script is actually doing.

解决方案

This worked for me, it might work for you: A web-focused Git workflow

这篇关于Git:推送到远程存储库时更新网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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