on
Managing Hugo With Git
As previously posted, this blog is powereded by Hugo, GitHub, and Cloudflare Pages. For most of my career, my exposure to git was cloning repos or downloading releases from GitHub. It was not a pattern for me to use git in any of my previous roles, so as you can imagine, I was a bit of a fish out of water when having to deal with git. This post may be very 101 for most folks, but for me, I wanted to document updating this blog using git.
Two Broad Approaches
There are two ways changes or new content can be done to this Hugo blog. Since the Hugo code’s versioning and deployment is managed by GitHub, we’ll have to make modifications to the GitHub repo. This can be done by:
- Making changes directly to the hugo site on the
main
branch - Creating a new Pull Request and merging it into
main
It’s generally a bad pattern to make changes directly on the main
branch because it should always be in a deployable state. I’ll be honest, sometimes I do make really minor changes to the main
branch but it’s something I generally avoid.
To IDE or Not to IDE
I have git properly configured for my blog GitHub repo on several of my machines which makes life easier if I want to update the blog. If I were traveling, I could always access GitHub and make changes directly on GitHub. If I wanted to make a quick edit to an existing post or page, I can just browse to the markdown file in my /posts
directory on Github and edit it within my browser.

Editing markdown of post in GitHub
If you miss the feel of VSCode you can hit the .
key and get a full blown webbased VSCode editor.
Merge and Deploy
Once my changes have made it into a new pull request, I’m able to merge the changes into my main
branch which will deploy the new changes. The Github actions rebuilds the blog and deploys the changes to Cloudflare pages.