Change a commit message that is already merged by pull request on a protected branch on GitHub

Strategy

Double Reverts

revert
Revert PR
git fetch origin pull/<YOUR PullRequest Number>/head:revertrevert
git switch revertrevert
$ git log
commit 0456ee900a4cb0dfd2ee2507b89ec84e5f52ad44 (HEAD -> revertrevert)
Author: Tsuyoshi Ushio <ushio@simplearchitect.com>
Date: Tue May 5 23:28:42 2020 -0700
Revert "Revert "Can't change directory""commit 0424d09025e2764a0e713fc36e991c0eac4cf074
Merge: cdc9bab ba74ece
Author: Tsuyoshi Ushio <ushio@simplearchitect.com>
Date: Tue May 5 23:28:33 2020 -0700
Merge pull request #2 from TsuyoshiUshio/revert-1-TsuyoshiUshio-patch-1Revert "Can't change directory"
git commit --amend
$ git log
commit 87c77062b5b450818d90e09462ecdc48759f9a8f (HEAD -> revertrevert)
Author: Tsuyoshi Ushio <ushio@simplearchitect.com>
Date: Tue May 5 23:28:42 2020 -0700
This is the proper commit message.commit 0424d09025e2764a0e713fc36e991c0eac4cf074
Merge: cdc9bab ba74ece
Author: Tsuyoshi Ushio <ushio@simplearchitect.com>
Date: Tue May 5 23:28:33 2020 -0700
Merge pull request #2 from TsuyoshiUshio/revert-1-TsuyoshiUshio-patch-1Revert "Can't change directory"
git push --set-upstream origin revertrevert
New PR from the revertrevert branch
Commit message changed!

Resources

Protected branch

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store