DEV Community

Kaleem Elahi
Kaleem Elahi

Posted on

🧠 2 Easy Ways to Rename a Git Commit Message (GUI or CLI)

Ever made a typo in your commit message πŸ˜… or forgot to follow proper commit message standards (like I did)? Don’t worry β€” renaming commits is easier than you think!

βœ… 1. Using Fork (Interactive Rebase – GUI method)

1️⃣ Open the repository in Fork
2️⃣ Right-click the commit you want to rename
3️⃣ Select Interactive Rebase > "Reword Message.."
This will open a dialog to edit the message and select rework instead of pick.
4️⃣ Save changes and push with --force if it was already pushed

✨ Super simple β€” perfect for visual thinkers, right?
Download: https://git-fork.com/

βœ… 2. Using Git commands (Terminal)

πŸ”„ To rename the most recent commit:

git commit --amend

Enter fullscreen mode Exit fullscreen mode

🧹 To rename older commits (via rebase):

git rebase -i HEAD~5  # Change 5 to however many commits you want to edit
Enter fullscreen mode Exit fullscreen mode
  • Replace pick with reword for the commits you want to rename
  • Then press: Esc β†’ :wq β†’ Enter to save and exit
  • Git will then prompt you to edit each commit message
  • After you're done:
git push --force
Enter fullscreen mode Exit fullscreen mode

⚠️ Don’t forget the --force push β€” if you skip this, your branch may get out of sync or duplicate commits may appear.

πŸ’¬ Have you tried the Fork method or the command line? Which one works better for you?

Git #GitTips #CommitMessages #ForkGit #CleanCode #100DaysOfCode #FrontendDev #DeveloperTools #Rebase

Top comments (0)