【问题标题】:How do I get branch created timestamp with PHP?如何使用 PHP 获取分支创建的时间戳?
【发布时间】:2019-08-14 14:12:49
【问题描述】:

我想使用shell_exec 创建 Git 分支(修补程序/功能)时间戳。

我在下面试过了,

shell_exec("git show --summary `git merge-base your_branch master`");

但它显示null

有谁知道怎么用 php 获取它?

【问题讨论】:

标签: php git git-shell


【解决方案1】:

您使用正确的命令获取提交哈希 (git merge-base),但 git show --summaryfor 分支点是 该死的谵妄!!!

git show -s --format=%ci <...>

another formats 表示另一个时间戳

【讨论】:

    猜你喜欢
    • 2022-11-11
    • 2018-12-13
    • 2017-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-20
    相关资源
    最近更新 更多