git history
Rewrite commits with simple subcommands (experimental)
The 'git history' command is a newer, experimental way to rewrite history without an interactive rebase, for example changing an old commit's message in one command. It is newer than the Git version this site verifies against (2.48), and its options may still change.
Synopsis
git history reword <commit>Examples
Change an old message
git history reword HEAD~2Opens the editor for that commit’s message.
Workflow Examples
git history reword HEAD~2Edit the message
git log --onelineCheck the result
Troubleshooting
git: 'history' is not a git command
Cause: Your Git is older than this experimental command
Use git rebase -i
Tips & Pitfalls
Best Practices
- ✓Only rewrite commits you have not pushed.
FAQ
No, it is marked experimental; prefer git rebase -i for now.