making empty commits

Published on 23 Aug 2017

No I don’t mean relationships. You can’t do that.

So I encountered problems when with my Hugo+Git installation. Whenever I pushed changes from local git repository, I spotted errors. But there was a problem. I could not test my fixes unless I made changes. I had no changes to made and this was a problem with the server-side git.

Solution? Make an empty git commit. This can be accomplished with a simple git command.

git commit --allow-empty -m “push an empty git commit”

GitPushEmptyCommit

This empty commit feature is really useful when debugging server-side issues. As you can see above, I was having problem with Hugo’s binary not registered in the $PATH when executed with git’s post-update hook. It worked fine through SSH, which the situation left me puzzled.

How did I fix it?

Absolute path to Hugo’s binary (my copy of Hugo was installed via LinuxBrew). A simple type hugo or which hugo command can easily reveal the binary’s location.