How To Add a Hyperlink Over Text in GitHub (Markdown, Issues, and More)
Adding a clickable link over text in GitHub isn’t done with a special “link button” inside GitHub itself. Instead, GitHub relies on Markdown, a simple text formatting language. Once you understand how Markdown links work, you can add hyperlinks in:
- README files
- Wiki pages
- Issues and pull requests
- Comments and code review discussions
The key idea: you write a short text snippet that Markdown turns into a clickable link when GitHub renders the page.
The Basics: How GitHub Markdown Links Work
In GitHub, you almost always create a hyperlink over text using this Markdown pattern:
[link text](https://example.com) - The text inside square brackets
[...]is what people see and click. - The address inside parentheses
(...)is the URL (or file path) the link points to.
For example:
Check out the [official GitHub Docs](https://docs.github.com/). Will show up as:
Check out the official GitHub Docs.
Where This Works in GitHub
You can use this format almost anywhere you can type text in GitHub:
README.mdand other.mdfiles in your repo- GitHub Wiki pages
- Issue descriptions and comments
- Pull request descriptions and review comments
- Discussion posts
GitHub automatically detects Markdown by file extension (.md, .markdown) and in many text boxes (issues, PRs, comments) where you’ll see a “Markdown supported” hint.
Common Ways to Add Hyperlinks Over Text
1. Link to an External Website
To link to a website:
[Google](https://www.google.com) - Visible text: Google
- Destination: https://www.google.com
You can use any valid URL here: documentation sites, blog posts, APIs, etc.
2. Link to Another File in the Same Repository
To point to a file in your repo, you can use a relative path instead of a full URL:
[View the LICENSE](LICENSE) [Open the contributing guide](docs/CONTRIBUTING.md) - GitHub will automatically turn these into links to files in the same branch.
- Relative paths keep working even if you move the repo to a different location or hosting.
3. Link to a Specific Heading in a Markdown File
You can also link directly to a section inside a file, like a heading in your README.
- GitHub auto-generates an anchor link for each heading.
- The pattern for most headings is roughly:
- Lowercase
- Spaces replaced with hyphens
- Punctuation removed
Example heading:
## Getting Started Auto-generated anchor on GitHub: #getting-started
So a link to that section might look like:
[Jump to Getting Started](#getting-started) To link to a heading in another file:
[See Installation section](docs/SETUP.md#installation) The exact anchor rules can be a bit nuanced, so a common trick is:
- View the rendered README on GitHub
- Hover over the heading
- Click the small link icon that appears
- Copy the full URL and use it in your Markdown link.
4. Link to an Issue, Pull Request, or Commit
You can link to GitHub items by:
Using full Markdown link
[Bug #42](https://github.com/owner/repo/issues/42) [Fix PR](https://github.com/owner/repo/pull/10) Using GitHub’s automatic linking
GitHub also auto-links certain patterns (even without Markdown):
#42links to issue or PR 42 in the same repoowner/repo#42links to issue/PR 42 in another repo- A commit hash like
abc1234links to that commit
You can still combine this with Markdown if you want custom text:
[Known login bug](#42) If you’re linking inside the same issue or PR list, many people just type #42, but Markdown gives you more descriptive labels.
5. Link an Image So the Image Is Clickable
You can make an image itself a clickable link by nesting Markdown:
[](https://destination-url.com) - Inner
= image - Outer
[...] ( ... )= link around that image
Special Link Cases in GitHub Markdown
1. Email Links
To create a “mailto” email link:
[Email support](mailto:[email protected]) Clicking it opens the user’s default email app (if configured).
2. Automatic Short Links (Without Markdown)
GitHub sometimes hyperlinks plain text automatically:
- Bare URLs like
https://example.com - Issue/PR references like
#123 - User mentions like
@username
These don’t give you custom text, though. If you want your own wording, you still use the [text](url) format.
3. Links in Code Blocks vs Normal Text
Be careful: Markdown inside fenced code blocks doesn’t render as links.
```markdown [Not a real link](https://example.com) The above will show literally as `[Not a real link](https://example.com)` since it’s meant to display code, not clickable text. If you want to show a link as **clickable text**, don’t wrap it in a code block. --- ## What Changes Depending on Where You’re Linking From? Even though the basic Markdown syntax is the same, your **context** in GitHub changes how you might write links. ### Contexts That Affect How You Add Links | Context | What Usually Matters Most | |------------------------------|------------------------------------------------------------| | README or docs in repo | Relative paths, section anchors, clarity for new visitors | | Issues and PRs | Linking related issues/PRs, commits, external references | | Wiki pages | Cross-linking pages, long-form docs structure | | Comments & Reviews | Quick references, minimal formatting | Some examples of how this plays out: - In a **README**, you might: - Use `[View the full documentation](docs/README.md)` - Reference headings with anchors - Prefer relative paths so the README stays portable. - In an **issue**, you might: - Link to a log file in the repo: `[error logs](logs/2024-04-01.log)` - Cross-link related issues: `See also #28 and #35` - Point to external bug reports or spec pages. - In a **wiki**, you might: - Link other wiki pages with `[[Page Name]]` (GitHub Wikis support a slightly different syntax in addition to Markdown) - Or still use standard Markdown links like `[API Guide](API-Guide)`. --- ## Variables That Affect How Your Links Should Be Set Up Someone else using the same Markdown link syntax could end up with very different results depending on several factors: 1. **Repository Structure** - Simple repo with one README vs complex project with `/docs`, `/src`, `/examples` - Whether you keep docs next to code or in a separate folder - How often files move or are renamed. 2. **Audience / Readers** - New contributors vs experienced maintainers - Internal team vs public open-source users - People reading on desktop vs mobile. 3. **Type of Content** - Short README vs full documentation site - Technical specs vs onboarding guide - Quick issue note vs long design proposal. 4. **Branching and Versioning** - Whether you link to `main` branch files or versioned folders like `docs/v1/` - Whether your links need to stay valid across many releases. 5. **Team Conventions** - Some teams prefer: - Relative links only (`docs/setup.md`) - Or full GitHub URLs - Or always linking to a specific branch or tag. All of these change what “good” hyperlinking looks like, even though the basic Markdown syntax doesn’t change. --- ## Different User Profiles, Different Linking Styles To see how this plays out, imagine three typical GitHub users all trying to “add a hyperlink over text”: ### 1. Solo Developer with a Small Project - Probably has: - One main `README.md` - A few source files - Likely to: - Use simple relative links like `[Usage](#usage)` - Point to one or two external sites (docs, demo, homepage) - Not worry much about versioned docs or complex structure. For this person, the main challenge is just remembering the `[text](url)` pattern and maybe how heading anchors work. ### 2. Maintainer of a Larger Open-Source Project - Has: - `/docs` directory with multiple `.md` files - GitHub Wiki or GitHub Pages site - Needs to: - Keep links working even when code moves - Decide between linking to `main` vs specific tagged versions - Cross-link issues, PRs, and discussion threads clearly. They might use: ```markdown [See v1.2 docs](docs/v1.2/README.md) [Design discussion](https://github.com/org/project/discussions/123) Their link choices affect how easy it is for users and contributors to navigate the project long-term.
3. Non-Developer Using GitHub for Documentation or Notes
- May be:
- Writing internal team docs
- Keeping personal notes or knowledge base
- Cares about:
- Easy-to-read formatting
- Links between pages/sections rather than code files
- Might use:
- More descriptive link texts like
[Onboarding Checklist](onboarding.md) - Internal anchors heavily:
[Jump to FAQ](#faq).
- More descriptive link texts like
For them, the hard part isn’t the syntax—it’s deciding how to structure pages and what to link where.
Where Your Own Situation Fills in the Gap
The Markdown pattern for adding a hyperlink over text in GitHub is simple:
[clickable text](destination-url-or-path) What changes is what you put inside that pattern:
- Whether the destination is:
- An external site
- A file in your repo
- A specific section in a long document
- An issue, PR, or commit
- Whether you use:
- Relative paths
- Full GitHub URLs
- Auto-generated anchors
- How you choose:
- Link text that makes sense for your readers
- A consistent structure across your project.
Those choices depend on your repo layout, audience, team habits, and how your project is likely to change over time. Understanding the link syntax is the foundation; the best way to apply it depends on how you’re actually using GitHub day to day.