【问题标题】:Git workflow from local to bitbucket/github hub to live webserverGit 工作流程从本地到 bitbucket/github hub 到实时网络服务器
【发布时间】:2013-11-20 16:50:25
【问题描述】:
【问题讨论】:
标签:
git
github
hosting
lamp
bitbucket
【解决方案1】:
这种推送后操作是托管的:
在这两种情况下,这些钩子都会生成一个 POST 钩子,通过其 API 将有效负载传递给您的第三方网络应用程序。
您的第三方应用程序负责接收和转换有效负载。
这意味着您的 Lamp VPS 服务器需要有一个能够解释所述有效负载的侦听器。
您可以通过执行git pull 来查看管理部署in this article 的脚本示例:
// Make sure we're in the right directory
exec('cd '.$this->_directory, $output);
$this->log('Changing working directory... '.implode(' ', $output));
// Discard any changes to tracked files since our last deploy
exec('git reset --hard HEAD', $output);
$this->log('Reseting repository... '.implode(' ', $output));
// Update the local repository
exec('git pull '.$this->_remote.' '.$this->_branch, $output);
$this->log('Pulling in changes... '.implode(' ', $output));