Featured image of post GitHub用提交消息来关闭issue

GitHub用提交消息来关闭issue

TL;DR: fix #1, fixed #2, resolve #3, close #4; YOUR COMMIT MESSAGE

一直很好奇这种在某个提交中关闭issue是怎么做到的

点进去仔细看发现image-20241127113340708

看来只要符合某种格式即可

根据GitHub官方文档,我们可以使用这些关键词:

  • close
  • closes
  • closed
  • fix
  • fixes
  • fixed
  • resolve
  • resolves
  • resolved

使用如下格式:

Linked issueSyntaxExample
Issue in the same repositoryKEYWORD #ISSUE-NUMBERCloses #10
Issue in a different repositoryKEYWORD OWNER/REPOSITORY#ISSUE-NUMBERFixes octo-org/octo-repo#100
Multiple issuesUse full syntax for each issueResolves #10, resolves #123, resolves octo-org/octo-repo#100
使用 Hugo 构建
主题 StackJimmy 设计