Why Markdown Relative Links Break in GitHub and GitLab Docs
Why Markdown relative links break usually comes down to context: the same link can resolve differently depending on the file location, branch, renderer, or export target. That is why README links may look fine during editing but fail after a docs restructure or release.
Common Causes
- Files moved: links like
../setup/install.mdno longer point to the same relative path. - Branches changed: links that work on
mainmay fail in release branches. - Headings renamed: anchor links break when section titles change.
- Docs exported: static-site generators may rewrite paths differently from GitHub or GitLab.
How to Fix Them
- Scan the Markdown from the same branch or source context users will read.
- Fix relative paths after file moves instead of converting every internal doc link to an absolute URL.
- Check heading anchors after editing section names.
- Run one final scan after exporting or publishing the docs site.
Practical Rule
Treat relative links as file-system references, not plain URLs. Any folder move, branch split, or export process can change what the link actually means.
To check a README or docs file now, use the Markdown link checker or the Git docs link checker for GitHub and GitLab workflows. If you need to repair targets, use the fix Markdown broken links workflow.
Related workflows
Use the workflow page that matches your source format so the checker and fixing options stay accurate.
Ready to clean your links?
Open the workflow that best matches this guide and check your links in seconds.
Open Markdown link checkerRelated Guides
5 README Link Mistakes That Break Docs on GitHub
The most common Markdown link mistakes in GitHub READMEs, and how to catch them before they confuse new users.
GitHub README Link Checker: How to Find Broken Docs Links
Use a GitHub README link checker to validate README links, relative paths, anchors, and external references before users hit dead docs.
How to Check Markdown Links in Git Repositories Before Release
A straightforward process for reviewing Markdown links in GitHub and GitLab docs before they go live.