【发布时间】:2022-11-14 08:56:24
【问题描述】:
当我从GitHub template 创建一个新的 GitHub 存储库时,第一条 git 提交消息会自动设置为:
初始提交
我怎样才能覆盖这个?我找不到更改设置中初始提交消息的方法。
【问题讨论】:
-
我不认为你可以。使用命令行创建您可以控制的第一个提交。
标签: github git-commit repo
当我从GitHub template 创建一个新的 GitHub 存储库时,第一条 git 提交消息会自动设置为:
初始提交
我怎样才能覆盖这个?我找不到更改设置中初始提交消息的方法。
【问题讨论】:
标签: github git-commit repo
可以使用定义 on.create 字段的 GitHub 操作来执行此操作,如下所示:
# The workflow will run only when `use this template` is used
on:
create:
看看我是如何在我的 foundry-template 项目中做到这一点的。
【讨论】:
正如@torek 的评论中提到的,您不能直接从 GitHub Web 应用程序更改提交消息,您可以在使用 git rebase -i --root 的 cli 将其克隆到系统中后执行此操作。说明可以参考this video
以下是您需要遵循的步骤:
【讨论】: