ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
# Crosslinking Issues > 原文:[https://docs.gitlab.com/ee/user/project/issues/crosslinking_issues.html](https://docs.gitlab.com/ee/user/project/issues/crosslinking_issues.html) * [From Commit Messages](#from-commit-messages) * [From Related Issues](#from-related-issues) * [From Merge Requests](#from-merge-requests) # Crosslinking Issues[](#crosslinking-issues "Permalink") 请通读[GitLab 问题文档](index.html)以获取有关 GitLab 问题的概述. ## From Commit Messages[](#from-commit-messages "Permalink") 每次在提交消息中提及问题时,您都在开发工作流的两个阶段之间建立一种关系:问题本身以及与该问题相关的第一次提交. 如果问题和您要提交的代码都在同一项目中,则只需在提交消息中添加`#xxx` ,其中`xxx`是问题编号. 如果它们不在同一项目中,则可以将完整的 URL 添加到问题中( `https://gitlab.com/<username>/<projectname>/issues/<xxx>` ). ``` git commit -m "this is my commit message. Ref #xxx" ``` or ``` git commit -m "this is my commit message. Related to https://gitlab.com/<username>/<projectname>/issues/<xxx>" ``` 当然,您可以使用自己的 GitLab 实例的 URL 替换`gitlab.com` . **注意:**将您的第一次提交与您的问题相关联,对于通过[GitLab Cycle Analytics](https://about.gitlab.com/stages-devops-lifecycle/value-stream-analytics/)跟踪您的过程将非常重要. 它将测量计划该问题的实施所花费的时间,即从创建问题到进行第一次提交之间的时间. ## From Related Issues[](#from-related-issues "Permalink") 在合并请求中提及相关问题以及其他问题对于您的团队成员和协作者了解有关同一主题的未解决问题很有用. 如上所述,当您[从提交消息中提到问题](#from-commit-messages)时,您可以执行此操作. 当在问题`#222`提到问题`#111`时,问题`#111`还将在其跟踪器中显示一条通知. 也就是说,您只需提及一次关系即可在两个问题中均显示该关系. 在[合并请求中](#from-merge-requests)提及问题时,也是如此. [![issue mentioned in issue](https://img.kancloud.cn/ab/1a/ab1ab62e005a0b2be17621500266b3a7_841x52.png)](img/mention_in_issue.png) ## From Merge Requests[](#from-merge-requests "Permalink") Mentioning issues in merge request comments works exactly the same way as they do for [related issues](#from-related-issues). 当您在合并请求说明中提到问题时,它将仅[将问题和合并请求链接在一起](#from-related-issues) . 此外,您还可以[将问题设置](managing_issues.html#closing-issues-automatically)为在合并请求合并后立即[自动关闭](managing_issues.html#closing-issues-automatically) . [![issue mentioned in MR](https://img.kancloud.cn/9b/eb/9beb5f40b86f5246f4789e05b6808ac7_849x50.png)](img/mention_in_merge_request.png)