Skip to content

Commit 3e926cd

Browse files
author
Eric James Michael Ritz
committed
Describe how to reword the most recent commit message
This is useful for when you realize that you forgot to mention something important, made a typo, etc. Obviously you should avoid using this on a commit which you have already pushed. Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
1 parent 76c268f commit 3e926cd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* [Delete local branch](https://github.com/git-tips/tips#delete-local-branch)
2020
* [Delete remote branch](https://github.com/git-tips/tips#delete-remote-branch)
2121
* [Undo local changes with the last content in head](https://github.com/git-tips/tips#undo-local-changes-with-the-last-content-in-head)
22+
* [Reword the previous commit message](https://github.com/git-tips/tips#reword-the-previous-commit-message)
2223
* [Changing a remote's URL](https://github.com/git-tips/tips#changing-a-remotes-url)
2324
* [Get list of all remote references](https://github.com/git-tips/tips#get-list-of-all-remote-references)
2425
* [Get list of all local and remote branches](https://github.com/git-tips/tips#get-list-of-all-local-and-remote-branches)
@@ -130,6 +131,11 @@ git push origin :<remote_branchname>
130131
git checkout -- <file_name>
131132
```
132133

134+
## Reword the previous commit message
135+
```sh
136+
git commit -v --amend
137+
```
138+
133139
## Changing a remote's URL
134140
```sh
135141
git remote set-url origin <URL>

tips.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
"title": "Undo local changes with the last content in head",
6565
"tip": "git checkout -- <file_name>"
6666
},
67+
{
68+
"title": "Reword the previous commit message",
69+
"tip": "git commit -v --amend"
70+
},
6771
{
6872
"title": "Changing a remote's URL",
6973
"tip": "git remote set-url origin <URL>"

0 commit comments

Comments
 (0)