Crosslinking Issues
Please read through theGitLab Issue Documentationfor an overview on GitLab Issues.
From Commit Messages
Every time you mention an issue in your commit message, you're creating a relationship between the two stages of the development workflow: the issue itself and the first commit related to that issue.
If the issue and the code you're committing are both in the same project, you simply add#xxx
to the commit message, wherexxx
is the issue number. If they are not in the same project, you can add the full URL to the issue (https://gitlab.com/
).
git commit-m"this is my commit message. Ref #xxx"
or
git commit-m"this is my commit message. Related to https://gitlab.com///issues/"
Of course, you can replacegitlab.com
with the URL of your own GitLab instance.
Note:Linking your first commit to your issue is going to be relevant for tracking your process far ahead withGitLab Cycle Analytics).它将测量计划所花费的时间implementation of that issue, which is the time between creating an issue and making the first commit.
From Related Issues
Mentioning related issues in merge requests and other issues is useful for your team members and collaborators to know that there are opened issues around that same idea.
You do that as explained above, whenmentioning an issue from a commit message.
When mentioning the issue "A" in issue "B", the issue "A" will also display a notification in its tracker. The same is valid for mentioning issues in merge requests.
From Merge Requests
Mentioning issues in merge request comments work exactly the same way they do forrelated issues.
When you mention an issue in a merge request description, you can eitherclose the issue as soon as the merge request is merged, or simply link both issue and merge request as described in theclosing issues documentation.
Close an issue by merging a merge request
Toclose an issue when a merge request is merged, use theautomatic issue closing pattern.