Github Commit Syntax to Link a Pull Request/ Issue

僤鯓⒐⒋嵵緔 提交于 2019-12-03 02:31:11

问题


I've seen commit messages that refer to a specific issue / pull request. What is the syntax to include a specific repository's issue or pull request?


回答1:


Use the documented auto-linking format for issues across repositories.

  • Syntax: {owner}/{repository}#{issue_number}
  • Example: mojombo/jekyll#1

When such formatted text is present in a commit message, it's automatically transformed into a clickable link which will redirect one to https://github.com/{owner}/{repository}/issues/{issue_number}




回答2:


Use #1234 in a comment to reference pull request 1234 from the current repo.




回答3:


Github share PR/Issue number use the same sequence.

So, one #number either one PR or one Issue.

Just use #number is OK.




回答4:


For linking to another repository, if you just paste the link to the issue or pull request, say https://github.com/{owner}/{repository}/issues/{issue_number}, GitHub will render it as

[{owner}/{repository}#{issue_number}](https://github.com/{owner}/{repository}/issues/{issue_number})

For example, https://github.com/jlord/sheetsee.js/issues/26 will render as jlord/sheetsee.js#26.

See https://help.github.com/articles/autolinked-references-and-urls/#issues-and-pull-requests



来源:https://stackoverflow.com/questions/23019608/github-commit-syntax-to-link-a-pull-request-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!