How to use GitHub autolinked references
Post GitHub URL, issue, SHA, @mention, and custom autolink tokens via gh --body-file, then prove stored source with gh issue view --json.
What this covers
In issues, pull requests, discussions, and similar conversation surfaces, GitHub turns many raw references into short links for you. You type the reference; GitHub renders the link. This how-to mirrors the tables and notes on Autolinked references and URLs.
flowchart LR
Input["Raw Reference: URL, #123, SHA, @user"] --> Engine["GitHub Autolink Engine"]
Engine --> Link["Clickable Hyperlink"]
Engine --> Card["Hover Card Preview"]URLs
Paste a normal URL. GitHub turns it into a link.
Visit https://github.com
For manual link Markdown, see Basic writing and formatting syntax.
Issues and pull requests
Inside conversations, these forms become short links:
| Reference type | Raw reference | Short link |
|---|---|---|
| Issue or pull request URL | https://github.com/jlord/sheetsee.js/issues/26 | #26 |
# and number | #26 | #26 |
GH- and number | GH-26 | GH-26 |
Username/Repository# and number | jlord/sheetsee.js#26 | jlord/sheetsee.js#26 |
Organization_name/Repository# and number | github-linguist/linguist#4039 | github-linguist/linguist#4039 |
If you put an issue, pull request, or discussion reference in a list, GitHub can unfurl title and state. See About tasklists.
Labels
Paste a label’s URL from the same repository and GitHub renders the label chip. Cross-repo label URLs stay ordinary links.
Find a label URL on the repository Labels page by opening a label. Example:
https://github.com/github/docs/labels/enhancementCommit SHAs
| Reference type | Raw reference | Short link |
|---|---|---|
| Commit URL | full …/commit/ URL | short SHA |
| SHA | full 40-character SHA | short SHA |
User@SHA | jlord@a5c3785… | jlord@a5c3785 |
Username/Repository@SHA | jlord/sheetsee.js@a5c3785… | jlord/sheetsee.js@a5c3785 |
Private-repo SHA caveat
When a commit message references a commit in a private repository, GitHub only shortlinks the SHA if at least one author or committer of the referencing commit has at least read access to the referenced commit.
Custom autolinks
If admins configured custom autolinks (for example Jira or Zendesk), matching references shorten the same way. Ask a repository admin which patterns exist. See Configuring autolinks to reference external resources.
Avoiding backlinks
A normal GitHub URL reference creates a backlink (for example, linking an issue from a PR also links the PR from the issue). To avoid that, build the URL with redirect.github.com instead of github.com. Hover cards are also skipped for those URLs.