Link to Issues, Pull Requests, and People in GitHub Markdown
To link to an issue or pull request on GitHub, type its number with a hash, like #26. To mention a person, type @ and their username. GitHub turns both into links when you post, so you don't write any Markdown link syntax. These shortcuts are a GitHub feature layered on top of Markdown, not part of Markdown itself, and they only work in some places.
Below: the reference forms, mentions, commit SHAs, and the cases where nothing gets linked.
Link to an issue or pull request
According to GitHub's documentation on autolinked references, references to issues and pull requests inside conversations on GitHub are converted to shortened links automatically. The docs list five forms:
| You type | What it means | |---|---| | https://github.com/jlord/sheetsee.js/issues/26 | A full issue or pull request URL | | #26 | Issue or pull request 26 in this repository | | GH-26 | The same thing, with a GH- prefix | | jlord/sheetsee.js#26 | Number 26 in another user's repository | | github-linguist/linguist#4039 | Number 4039 in an organization's repository |
The last two forms are how you point across repositories. Use owner/repo#number and GitHub resolves it for you.
Let GitHub suggest the number
You don't have to remember numbers. GitHub's basic formatting guide says that typing # brings up a list of suggested issues and pull requests in the repository. Type a number or part of a title to filter the list, then press Tab or Enter to complete the result.
References in lists show the title
Put a reference in a list item and GitHub does a little extra. The autolink docs say a reference to an issue, pull request, or discussion in a list unfurls to show the title and state instead of just the number. A list of # references then reads like a status board.
Mention people and teams
Type @ followed by a username and GitHub links to that person's profile and notifies them. The basic formatting guide says the same works for teams: @github/support What do you think about these updates? mentions the support team in the github organization.
A few rules from the docs are worth knowing:
- Editing a comment to add a mention also sends a notification.
- A person is only notified if they have read access to the repository and, when an organization owns it, belong to that organization.
- Mentioning a parent team also notifies members of its child teams.
- For a team mention, every member of the team is subscribed to the conversation.
So an @ in a public thread doesn't guarantee the person hears about it. If they can't see the repository, they won't be pinged.
Reference a commit
Commits work the same way. A full SHA, a commit URL, User@SHA, or Username/Repository@SHA all become shortened links to the commit. One caveat from the docs: when you reference a commit from a private repository inside a commit message, the SHA is only shortlinked if at least one author or committer of that commit has read access to it.
Use references in task lists
References fit naturally in a task list, which is how many teams track work:
- [x] #739
- [ ] https://github.com/octo-org/octo-repo/issues/740
- [ ] Add delight to the experience when all tasks are completeThis example comes straight from GitHub's formatting guide. If you want the checkbox syntax itself explained, see task lists and checkboxes in Markdown.
How these references differ from URL autolinks
People often mix these up with URL autolinks, where a plain address becomes clickable. The GitHub Flavored Markdown spec defines autolinks for URLs, www. addresses, and email addresses. It doesn't define #26 or @username. Those are platform features that GitHub adds when it renders a conversation. For the spec-level rules, read when plain URLs become clickable links.
That difference explains the biggest surprise for newcomers. The autolink docs state that autolinked references are not created in wikis or files in a repository. So #26 in a README.md stays plain text. In a file, write an explicit link instead, using the full issue URL. If you're unsure of the syntax, inline and reference-style links are covered in a separate guide.
Stop a reference from linking
Sometimes you want the characters without the link. The formatting guide says you can tell GitHub to ignore Markdown formatting by putting a backslash before the Markdown character. See the backslash escaping guide for the general rules. The same page notes that Markdown formatting is not ignored in the title of an issue or pull request.
There is a separate trick for backlinks. By default, a reference creates a backlink: link to an issue from a pull request and GitHub adds a link from the issue back to the pull request. To avoid that, use redirect.github.com instead of github.com in the URL. The docs add that no hover pop-up appears for such a link, and that the method isn't supported on ghe.com.
Doing this with Carets
If you draft issue descriptions, release notes, or pull request text before pasting them into GitHub, a plain-text editor keeps the workflow simple. Carets is a fast, native notes and code editor for iPhone, iPad, and Mac that handles Markdown, plain text, and code with syntax highlighting. You can keep a reusable snippet file with your owner/repo#number references and mention lists, organized into files, projects, and tags.
One honest limit: Carets edits the text, and GitHub does the linking. The references turn into links only after you post them in a GitHub conversation. Your files stay plain text, so they stay portable.
Download Carets for iPhone, iPad, and Mac on the App Store.
Frequently Asked Questions
Why doesn't #123 turn into a link in my README.md?
GitHub's documentation says autolinked references are not created in wikis or files in a repository. They work in conversations such as issues and pull requests. In a file, write a full link with the issue URL.
How do I link to an issue in a different repository?
Write owner/repo#123, for example jlord/sheetsee.js#26. For an organization, use the organization name in place of the user name, as in github-linguist/linguist#4039.
Does mentioning someone with @ always notify them?
No. A person is notified only if they have read access to the repository and, for an organization-owned repository, are a member of that organization.
Can I link to an issue without creating a backlink?
Yes. Use a redirect.github.com URL in place of github.com. GitHub notes this isn't supported on ghe.com.