Blog: align master to commit

TL;DR

Saving some typing when dealing with the blog.

From time to time I have to fix some error in a post of the blog, which can cause some major annoyances if I already canned some future post. Luckily, this is a solved problem (Rebase and retag, automatically).

When I do this, I usually want the changes to appear as soon as possible, without waiting for the automatic publishing to kick in (usually the next morning). So I switch temporarily to master, align it to the remote, …. wait! Why do I do this?

Long story short, when I want to align master to a specific commit (which is devel by default), I use this:

1 2 3 4 5 6 7 8 9
#!/bin/sh
set -eux
[ $# -eq 0 ] && ref='devel' || ref="$1"
git checkout master
git pull
git merge --ff-only "$ref"
git push
git checkout devel
git push

This script is also available in the repository.

Aaaaaand… some typing is saved for greater good!


Comments? Octodon, , GitHub, Reddit, or drop me a line!