I have two commits that I just pushed to github
The 2nd commit message after the 1st commit message is actually a bit messed up.
Is there a way to change the 2nd commit message after pushing it to github?
I know amend will work only if it hasn’t been pushed to github. No one hasn’t branched off my current dev branch, so it’s safe to assume that no one will be affected if I do this.
Try using Git’s interactive rebasing feature. From git-rebase(1):
If you run
git rebase --interactive HEAD~2, you’ll be able to instruct Git to reword the second-most-recent commit message. Chapter 6.4 in Scott Chacon’s Pro Git has a lot of good information about interactive rebasing.As hobbs has already commented above, you’ll still need to do a forced push.