RE: How to modify existing, unpushed commit messages?

John Q Reviewer Asked on August 14, 2019 in Programmer.
Add Comment
1 Answers
git commit --amend

will open your editor, allowing you to change the commit message of the most recent commit. Additionally, you can set the commit message directly in the command line with:

git commit --amend -m "New commit message"

…however, this can make multi-line commit messages or small corrections more cumbersome to enter.

Make sure you don’t have any working copy changes staged before doing this or they will get committed too. (Unstaged changes will not get committed.)

Trainee Answered on August 14, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.