Elena' s AI Blog

Testing Blog Designs with Git Branches and GitHub Pages

20 Feb 2026 (updated: 24 Aug 2026) / 9 minutes to read

Elena Daehnhardt


Generated by Midjourney. Prompt: AI-assisted coding with a robot reviewing a pull request.

If you click an affiliate link and subsequently make a purchase, I will earn a small commission at no additional cost (you pay nothing extra). This is important for promoting tools I like and supporting my blogging.

I thoroughly check the affiliated products' functionality and use them myself to ensure high-quality content for my readers. Thank you very much for motivating me to write.



TL;DR:
  • Create a feature branch, push it to GitHub, change the GitHub Pages source to that branch in Settings, preview it live, then merge into main when you are happy.

Previous: Part 30 — Git Cherry-Pick: The Surgeon's Knife

Next: Part 32 — Live Design Testing with GitHub Pages and a Custom Domain

Testing Blog Designs with Git Branches and GitHub Pages

I have a habit of tweaking my blog design and then immediately second-guessing myself. Does this colour scheme actually work? Is this layout easier to read, or just different? For a long time, the only way I could really tell was to push the change live and look at it in a real browser — which felt a bit reckless. Then I discovered that [GitHub Pages][1] lets you publish from any branch, not just main, and everything changed.

GitHub Pages branch deployment is a workflow that publishes a live preview of a Jekyll site from any Git branch you choose, so a design experiment can run on a real public URL without ever touching the branch that serves your production traffic. Here is the technique I now use whenever I want to compare two designs side by side before committing to one.

GitHub Pages Branch Deploys: Why Branches Work for Design Testing

Git branches are usually associated with software features or bug fixes, but they are genuinely useful for design experiments too. A Git branch is an independent line of development within a repository that lets you make changes without affecting the code on main. The idea is simple: your main branch holds the version of your blog that is live and working. You create a new branch for your design experiment, push it to GitHub, and then tell GitHub Pages to serve from that branch instead. You get a real, live preview of your experiment — fonts, layouts, colours, everything — without touching your production site.

When you are happy with the result, you merge the branch into main and delete it. If you decide the experiment was a bad idea, you just delete the branch and nothing has changed.

Subscribe to unlock the full article ❤️

I keep most of the site completely open. A few unusually detailed tutorials need a free subscriber login so I can keep publishing this kind of work.

The form below signs you up for the newsletter. It does not log you into the app — log in afterwards (same email) to unlock this article and download your subscriber gifts. New subscribers get an inbox mail: Set a password to unlock articles.

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.

Citation
Elena Daehnhardt. (2026) 'Testing Blog Designs with Git Branches and GitHub Pages', daehnhardt.com, 20 February 2026. Available at: https://daehnhardt.com/blog/2026/02/20/testing-blog-designs-with-git-branches-and-github-pages/
All Posts