How to use smart commits


#1

Important Notes

  • This post is based on Gogs 0.8.43.0223.

Smart commits are the ones containing special keywords to reference or control repository issues.

Currently, this feature only supports commits to control issues in the same repository.

Referencing an issue

To reference an issue from your commit message, simply use syntax #{index}, such as #18, and there will be a reference message in the corresponding issues.

Multiple references to the same issue in single commit message will only produce one reference message.

Closing and reopening an issue

This works pretty much the same way as GitHub does.

To close or reopen an issue, you must use the syntax {action} #{index}. For example, to close an issue by using fix #18.

Or you can reopen it in the next commit by using reopen #18.

The following list shows all available keywords for closing and reopening an issue:

  • Close: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved
  • Reopen: reopen, reopens, reopened

:speech_balloon: Please leave comments if you have any questions or concerns about this post.


Reference a commit hash in an issue
如何向github一样关联工单~
Closing Pull Request via the cmd line doesn't show the "Merged" label
Link pull request to issue(s)