Change a Commit Message Before It Has Been Pushed
March 20, 2020
Amend the Most Recent Commit Message
The most recent commit's message can be modified by using the commit --amend command.
Open an Editor to edit the commit message
1.git commit --amend
This will open up an editor with the previous commit message that you can edit to something else. Usually the editor will have comments about what will be committed, to what branch, and the date of the original commit.
Example
1.> git commit --amend
1.Add NPM open package to home page2.3.# Please enter the commit message for your changes. Lines starting4.# with '#' will be ignored, and an empty message aborts the commit.5.#6.# Date: Thu Mar 19 18:26:41 2020 -07007.#8.# On branch master9.# Your branch is up to date with 'origin/master'.10.#11.# Changes to be committed:12.# new file: content/nano/npm/2-open-package-home-page.md13.#
Modify Commit message in the command line
1.git commit --amend -m "Updated message"
The -m command will directly set the commit message in the same way running git commit -m "message" directly sets the message when creating the commit.
More Git Snippets
Popular Articles
I Can't Believe It's Not CSS: Styling Websites with SQL
Style websites using SQL instead of CSS. Database migrations for your styles. Because CSS is the wrong kind of declarative.

How I Built an Oreo Generator with 1.1 Sextillion Combinations
Building a web app that generates 1,140,145,285,551,550,231,122 possible Oreo flavor combinations using NestJS and TypeScript.

AI Model Names Are The Worst (tier list)
A comprehensive ranking of every major AI model name, from the elegant to the unhinged. Because apparently naming things is the hardest problem in AI.