从 gitlab 中的提交消息中引用问题
Reference an issue from a commit message in gitlab
是否可以从提交消息中引用 Gitlab 中的问题?
我在网上没有找到任何东西。
应该有一种方法可以从提交消息中引用 GitLab 问题,只需使用 #xx(问题 ID)即可。
考虑“Default closing pattern value ”
For example the following commit message:
Awesome commit message
Fix #20, Fixes #21 and Closes group/otherproject#22.
This commit is also related to #17 and fixes #18, #19
and https://gitlab.example.com/group/otherproject/issues/23.
will close #18, #19, #20, and #21 in the project this commit is pushed to, as well as #22 and #23 in group/otherproject. #17 won't be closed as it does not match the pattern. It works with multi-line commit messages as well as one-liners when used with git commit -m.
另请参阅“Tutorial: It's all connected in GitLab”
Add references in issue or merge request descriptions or in comments.
This will update the issue with info about anything related.
- To reference an issue:
#123
- 要引用 MR:
!123
- 引用片段
3
pierreb adds :
Although this is not specifically asked in the original question, it may be worth adding that one can also cross-reference a previous commit in a new commit message in Gitlab.
You do it by copying the hash from the commit message you want to reference and simply pasting it in the new commit message.
Something along these lines:
This is related with commit 7as7b101
您可以在以下位置看到(更多)更多信息:
Fr0zenFyr adds :
Similarly, even a closed issue can be referenced like Related to #78 and #93
是否可以从提交消息中引用 Gitlab 中的问题? 我在网上没有找到任何东西。
应该有一种方法可以从提交消息中引用 GitLab 问题,只需使用 #xx(问题 ID)即可。
考虑“Default closing pattern value ”
For example the following commit message:
Awesome commit message
Fix #20, Fixes #21 and Closes group/otherproject#22.
This commit is also related to #17 and fixes #18, #19
and https://gitlab.example.com/group/otherproject/issues/23.
will close #18, #19, #20, and #21 in the project this commit is pushed to, as well as #22 and #23 in group/otherproject. #17 won't be closed as it does not match the pattern. It works with multi-line commit messages as well as one-liners when used with git commit -m.
另请参阅“Tutorial: It's all connected in GitLab”
Add references in issue or merge request descriptions or in comments.
This will update the issue with info about anything related.
- To reference an issue:
#123
- 要引用 MR:
!123
- 引用片段
3
pierreb adds
Although this is not specifically asked in the original question, it may be worth adding that one can also cross-reference a previous commit in a new commit message in Gitlab.
You do it by copying the hash from the commit message you want to reference and simply pasting it in the new commit message.
Something along these lines:
This is related with commit 7as7b101
您可以在以下位置看到(更多)更多信息:
Fr0zenFyr adds
Similarly, even a closed issue can be referenced like
Related to #78 and #93