Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

I wrote the wrong thing in a commit message.

How can I change the message? The commit has not been pushed yet.

1 Answer

0 votes
by (50.2k points)
edited by

 For modification of existing, unpushed commit messages we use following commands.

$git commit --amend 

            Or

$git commit --amend -m “new message”

  Where 

$git commit --amend 

will open an editor where you can edit the message, and you can directly give the modified message to existing and unpushed commit messages.  

Browse Categories

...