Changing a commit message with Git

๐Ÿ’กYou can change a commit message only for emergencies, so I recommend you be careful because you can break the pull request's reference.

ยท

1 min read

๐Ÿ‡ป๐Ÿ‡ช Spanish

1.- If you wrote a commit message incorrectly and pushed it, you can change this message immediately using git commit --amend command, this command open a text editor to change the message. For exit press ESC + Shift + : and write :wq to save changes.

git commit --amend

2.- Force push with command:

git push origin main -f

3.- Use git log command to see historical changes.

git log

Reference:

git-scm.com/book/es/v2

ย