Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Version bump

Lucas Werkmeister edited this page Sep 7, 2016 · 1 revision

A one-liner to reapply an old “bump version” commit, with version numbers updated:

commit=da71e49; ver1=1.2.2; ver2=1.2.3; ver3=1.3.0; patch=$(git format-patch $commit^..$commit) && sed -i "s/$ver2/$ver3/g;s/$ver1/$ver2/g" -- "$patch" && git am --ignore-date -- "$patch"; rm -f -- "$patch"

Update the four variables at the start, leave the rest as it is. Afterwards, tweak the commit as needed. (Alternatively, you could probably use git diff instead of git format-patch, and pipe that through sed into git apply without creating a commit yet.)

Clone this wiki locally