On this page
A default-branch change can leave a README reachable while changing the files its links and images resolve to. Before a documentation release, inventory links that depend on the default branch, links that name a branch, and links pinned to a commit. Then check both accessibility and whether each destination is the intended release content.
This checklist uses a local test repository and a fictional GitHub repository. The current GitHub documentation for repository URLs, branch references, and permalinks was not available to consult for this article, so confirm GitHub-specific behavior in the documentation and your repository before relying on it. The commands below were not executed for this article.
Key Takeaways
- A repository home page and relative README links can depend on the branch GitHub is displaying; changing the default branch can change what visitors see.
- A link that explicitly names an old branch does not automatically become a link to the new branch. A commit-pinned link instead identifies a particular revision.
- A successful HTTP response is only a reachability signal. Open the destination and verify its contents, revision, image, or release asset.
- Test the experience for forks, private repositories, renamed repositories, and users who are not signed in.
Identify which links can change
Use this table to classify links before checking them. OWNER and REPO are placeholders, not a real repository.
| Link in or near a README | What to review |
|---|---|
Repository home page, such as https://github.com/OWNER/REPO | The page normally presents the default branch. Confirm the displayed README after the change. |
Relative link, such as [Setup](docs/setup.md) | When GitHub renders the README in a branch context, the destination can depend on that context. Check it on the default branch and in any other rendering environment you publish to. |
Relative image, such as  | Check both the file and the rendered image on the intended branch. A file with the same name can contain different content. |
Branch-named link, such as https://github.com/OWNER/REPO/blob/docs-old/docs/setup.md | It continues to name docs-old; verify that branch still exists and contains the intended version. |
Commit-pinned link, such as https://github.com/OWNER/REPO/blob/COMMIT_SHA/docs/setup.md | It identifies a fixed revision rather than following a branch. Verify that the commit and file remain accessible to the intended readers. |
| Release asset link | Check the release or tag selected by the URL and verify the actual downloadable asset. A branch check alone does not validate it. |
Relative links can behave differently when Markdown is rendered outside GitHub, including in a documentation site or package registry. Test each published rendering rather than assuming it uses GitHub's context. Branch names can also contain slashes, so avoid parsing a GitHub URL by simply treating the first path segment after blob as the complete branch name.
Advertisement
Prepare a local review example
The following lab creates two branches with different versions of a file. It also adds a relative image, an explicit old-branch link, a commit-pinned link, and a fictional release-asset link. It requires Git and a POSIX-compatible shell. It does not create a GitHub repository or change a remote default branch.
lab_dir=$(mktemp -d)
cd "$lab_dir" || exit 1
git init -q
git symbolic-ref HEAD refs/heads/docs-old
git config user.name "Documentation Lab"
git config user.email "documentation-lab@example.invalid"
mkdir -p docs
printf '%s\n' 'Legacy setup instructions' > docs/setup.md
cat > docs/architecture.svg <<'EOF'
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="30">
<text x="5" y="20">Architecture</text>
</svg>
EOF
git add docs
git commit -qm "Add initial documentation"
pinned_commit=$(git rev-parse HEAD)
cat > README.md <<EOF
# Documentation lab
[Setup](docs/setup.md)

[Old-branch setup](https://github.com/OWNER/REPO/blob/docs-old/docs/setup.md)
[Pinned setup](https://github.com/OWNER/REPO/blob/$pinned_commit/docs/setup.md)
[Release asset](https://github.com/OWNER/REPO/releases/latest/download/guide.zip)
EOF
git add README.md
git commit -qm "Add README links"
git checkout -qb docs-new
printf '%s\n' 'Release setup instructions' > docs/setup.md
git add docs/setup.md
git commit -qm "Update setup for release"
Compare the versions locally:
git show docs-old:docs/setup.md
git show docs-new:docs/setup.md
git show "$pinned_commit":docs/setup.md
git show docs-new:docs/architecture.svg
The two branch versions are intended to differ; the pinned commit identifies the original file. The release-asset URL is illustrative: this lab does not publish an asset, and its placeholder links are not destinations to check on the public internet.
For a GitHub rendering test, create an authorized test repository, replace OWNER and REPO in the README with its actual owner and name, and publish both branches. Publish a harmless test asset separately if you want to exercise the release link. View the README on each branch, then change the test repository's default branch and inspect its home page again. Use GitHub's current documentation and repository settings to confirm the steps for your environment.
Release review checklist
1. Inventory links and the intended branch
- Record the current default branch, the proposed default branch, and the release revision. Confirm the default in the repository's GitHub settings; a local checkout alone does not establish it.
- Search README files and other release-facing Markdown for inline links, reference-style links, and HTML links or images. This quick search is a starting point, not a complete Markdown parser:
git grep -n -I -E '(\]\(|^\[[^]]+\]:|<(a|img)[[:space:]])' -- '*.md' '*.mdx' || true
- Inspect generated documentation, badges, linked files, and image sources too. Search for the old branch name separately, including in scripts or templates that generate links.
- Classify each destination as relative, branch-named, commit-pinned, or a release asset. Record which version readers should see.
2. Check files and images on both branches
- Open the repository home page and README on the old and proposed default branches. Follow relative file links from each rendered README.
- Read enough of each destination to confirm its title, instructions, and version are correct. A valid file at the same path can still be the wrong document.
- Confirm images actually render and depict the intended diagram. Also check that their alternative text remains appropriate.
- For branch-named links, decide whether to retain the old branch reference, update it to the new branch, or pin it to a commit. For permalinks, confirm the pinned content is intentionally historical rather than accidentally stale.
Advertisement
3. Check release assets and HTTP behavior
- Open each release link and download the intended asset using a test account appropriate to the audience. Check its name, version, and contents or published checksum where available. Do not run an unfamiliar downloaded executable merely to test a link.
- Inspect redirects as well as the final response. A rename or asset download may involve a redirect; a successful final page does not prove it is the right file. Record unexpected redirects for investigation.
- Repeat public-link checks while signed out or in a private browser session. For private repositories, test with an authorized account and separately confirm the expected access failure for an unauthorized user. A missing-resource response can also reflect an access restriction, so do not diagnose it as a broken path without checking permissions.
For a public, trusted URL, this command follows a limited number of redirects and reports the final status and effective URL. Replace the placeholder with a real link you are authorized to check:
url='https://github.com/OWNER/REPO'
curl --location --max-redirs 5 --connect-timeout 10 --max-time 30 \
--output /dev/null --write-out 'status=%{http_code} final=%{url_effective}\n' \
-- "$url"
This performs a GET, so it can download response data even though it discards the body. Avoid using it on large assets without an appropriate download limit, and use time and resource limits in automated checks. Do not put access tokens in URLs or logs. Check redirected destinations before sending credentials to them, and do not use this command as an unrestricted service for fetching untrusted URLs. A status check does not inspect the returned document or establish that it is correct.
4. Check forks, renames, and access
- In a fork, inspect relative links from the fork's rendered README. Confirm whether readers should see the fork's files or the upstream project's files; explicit upstream URLs may be preferable when upstream is the intended destination.
- After a repository rename or move, inspect both existing links and their redirect destinations. Update maintained links where practical rather than treating redirects as a permanent guarantee.
- Verify that the intended audience can access the repository, pinned commit, and release asset. A link that works for a maintainer may not work for a contributor or anonymous reader.
- After the default-branch change, repeat the home-page, image, file, and asset checks against the published repository. Keep a record of failures and owners before announcing the release.
Common Mistakes
- Treating every README link as default-branch-dependent. An explicit branch link can stay on the old branch; a commit permalink identifies a particular revision.
- Trusting a status code alone. A response can lead to a login page, an unintended redirect, or a valid but outdated document.
- Checking only the source Markdown. An image path can look correct while the rendered image is missing or wrong.
- Assuming a fork or rename preserves intent. A reachable destination may belong to a different repository or contain different content.
- Assuming private and public readers have the same access. Test the actual roles and visibility expected for the release.
Best Practices
Choose relative links when the intended target should follow the README's branch context, explicit branch links when a named branch is deliberate, and commit-pinned links when the exact historical content matters. Document exceptions in the release checklist, and include both link accessibility and content review in your release process.
Conclusion
A default-branch change is a content-routing change as well as a repository setting. Review the rendered README, follow its file and image links, and verify release assets for the intended audience before publishing.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.