Posted about 8 years ago. Visible to the public.

Change commit messages of past Git commits

To change a commit message of the most recent (unpushed) commit, you can simply use
git commit –amend -m 'new message'

To change messages of (unpushed) commits further in the past:

Copy
git rebase -i [COMMIT BEFORE THE FIRST YOU WANT TO EDIT]

Mark all messages to be changed with "edit".

Git will start the rebasing and stop at every marked commit. For each of those, do a
git commit –amend -m 'new message'
git rebase –continue

Growing Rails Applications in Practice
Check out our new e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Owner of this card:

Avatar
Tobias Kraze
Last edit:
about 8 years ago
Keywords:
history, manipulate, rewrite
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more