【问题标题】:How to deploy 'develop' branch using GIT's hooks?如何使用 GIT 的钩子部署“开发”分支?
【发布时间】:2016-06-21 15:27:38
【问题描述】:

您好,正在按照this 教程在我的服务器中创建一个 git 挂钩,它将源文件从 repo '复制'到另一个目录。

这是 post-receive 钩子,效果很好:

#!/bin/sh
git --work-tree=/var/www/domain.com --git-dir=/var/repo/site.git checkout -f

但我需要从我的开发分支而不是从主分支“复制”文件。我怎样才能做到这一点?

【问题讨论】:

    标签: git deployment githooks git-bash


    【解决方案1】:

    你可以在末尾指定分支名称。

    git --work-tree=/var/www/domain.com --git-dir=/var/repo/site.git checkout develop -f

    【讨论】:

      猜你喜欢
      • 2023-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-11
      • 2023-03-04
      相关资源
      最近更新 更多