From 3e926cdc9efe7ec431c0f1b4819d44205a6b0b6c Mon Sep 17 00:00:00 2001 From: Eric James Michael Ritz Date: Wed, 29 Jul 2015 18:58:03 -0400 Subject: [PATCH] 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 --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index fef9feb..6f8ed1d 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ * [Delete local branch](https://github.com/git-tips/tips#delete-local-branch) * [Delete remote branch](https://github.com/git-tips/tips#delete-remote-branch) * [Undo local changes with the last content in head](https://github.com/git-tips/tips#undo-local-changes-with-the-last-content-in-head) +* [Reword the previous commit message](https://github.com/git-tips/tips#reword-the-previous-commit-message) * [Changing a remote's URL](https://github.com/git-tips/tips#changing-a-remotes-url) * [Get list of all remote references](https://github.com/git-tips/tips#get-list-of-all-remote-references) * [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 : git checkout -- ``` +## Reword the previous commit message +```sh +git commit -v --amend +``` + ## Changing a remote's URL ```sh git remote set-url origin diff --git a/tips.json b/tips.json index 788eedd..e155aa7 100644 --- a/tips.json +++ b/tips.json @@ -64,6 +64,10 @@ "title": "Undo local changes with the last content in head", "tip": "git checkout -- " }, + { + "title": "Reword the previous commit message", + "tip": "git commit -v --amend" + }, { "title": "Changing a remote's URL", "tip": "git remote set-url origin "