This guide provides instructions to upgrade the Jekyll Chirpy theme from version 6.2 to the latest version, 7.4.1.
This guide will also be used as reference on future upgrades.
- Git installed
- Ruby and Bundler installed
Current Version: v6.2.2 Latest Version: v7.4.1 https://github.com/cotes2020/chirpy-starter/compare/v6.2.2...v7.4.1
If you haven't done so before, add the chirpy-starter repository as a remote to your local Git repository.
git remote add chirpy https://github.com/cotes2020/chirpy-starter.gitTo verify the remote was added successfully, run:
git remote -vYou should see chirpy in the output.
Fetch all the tags from the upstream chirpy remote:
git fetch chirpy --tagsMerge the latest tag from upstream into your local branch.
git merge v7.4.1 --squash --allow-unrelated-historiesNote: The --squash flag combines all the changes from upstream into a single commit, keeping your commit history clean. The --allow-unrelated-histories flag is necessary if your local branch and the upstream theme do not share a common Git history.
It is common to encounter merge conflicts, especially if you have made customizations to the theme files. You will need to manually resolve these conflicts.
- Run
git statusto see a list of unmerged files. - Open each conflicting file in a text editor. You will see the conflicting changes marked with
<<<<<<<,=======, and>>>>>>>. - Edit the files to keep your changes, the theme's updates, or a combination of both. Remove the conflict markers.
- Once you have resolved the conflicts in a file, stage it using
git add <filename>.
After resolving all conflicts, commit the changes to your local repository:
git commit -m "Upgrade to v7.4.1"Finally, update your local theme gems:
bundle updateBefore upgrading, it's a good practice to check the release notes on GitHub for any breaking changes or specific instructions for the new version.
After upgrading, always test your website locally to ensure everything works as expected before deploying the changes. You can run your site locally with:
bundle exec jekyll serve -l
OR
bash tools/run.shIf the upgrade introduces issues or does not work as expected, you can revert the changes using Git.
If you followed the upgrade steps and created a single merge commit (as suggested with --squash), you can revert this commit:
git revert <commit-hash-of-upgrade>To find the commit hash, you can use git log. Look for the commit message "Upgrade to v7.4.1" (or whatever message you used).
If you need to discard all changes since the last good commit before the upgrade, you can perform a hard reset. Be extremely careful with this command as it will discard all uncommitted changes and revert your working directory to the state of the specified commit.
git reset --hard <commit-hash-before-upgrade>Replace <commit-hash-before-upgrade> with the hash of the commit before you started the upgrade process.
After reverting the code, you might also need to revert your Gemfile.lock or run bundle install to ensure your dependencies match the reverted state.
bundle installThe upgrade to Jekyll Chirpy theme version 7.4.1 was successfully completed, but it encountered and resolved several issues:
-
Native gem compilation errors: During
bundle update, the process failed when trying to compile thejson(version 2.15.2) andracc(version 1.8.1) gems. The error was caused by a missinggmkdirutility in the build process on macOS. -
YAML syntax error: After resolving the gem compilation issues, starting the Jekyll server revealed a YAML syntax error in
_data/share.ymlat line 5, column 27. The first entry had improperly formatted inline syntax whereiconwas on the same line astype. -
Incorrect Image Paths: After upgrading, the images on each post were not being rendered.
-
Fixed native gem compilation:
- Installed the
coreutilspackage viabrew install coreutilsto provide the missinggmkdirutility - Installed the problematic gems individually:
gem install json -v '2.15.2'andgem install racc -v '1.8.1' - Then successfully ran
bundle updateto complete the dependency updates
- Installed the
-
Fixed YAML syntax error:
- Corrected the formatting in
_data/share.ymlwhere the LinkedIn platform entry had invalid inline syntax - Changed from
type: Linkedin icon: "fab fa-linkedin"to separate lines:- type: Linkedin icon: "fab fa-linkedin" link: "https://www.linkedin.com/sharing/share-offsite/?url=URL"
- Corrected the formatting in
-
Incorrect Image Paths: Relative paths were changed to absolute paths
BEFORE:
- Jekyll theme successfully upgraded to Chirpy v7.4.1
- All dependencies updated and compatible
- Local Jekyll server running successfully at http://127.0.0.1:4000
- Site builds without errors
- Ready for deployment

