Git commit signing issue

I, like many others, sign my Git commits with GPG. This had been working fine for a while, but when updating to Git 2.10.0, I was always presented with an error when trying to sign a commit

error: gpg failed to sign the data fatal: failed to write commit object

On my windows box, I appear to have both GPG1 and GPG2 installed. Git didn’t like trying to sign with GPG1, so this needed to be forced to use GPG2. Thankfully, this solution is simple:

git config --global gpg.program gpg2

Then sign your commit as usual and voila! No more errors.