From 184bcc1ddf698e73496eb6af6bb996aec04be77c Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 4 Sep 2015 08:55:25 +0800 Subject: [PATCH 1/2] Add another way to change commit message. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ff599f9..a199f08 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,13 @@ If you wrote the wrong thing and the commit has not yet been pushed, you can do $ git commit --amend ``` +The another way to change commit message: + +```sh +$ git reset --soft HEAD^ +$ git commit -a -m 'xxxxxxx' +``` + If you have already pushed the message, you can amend the commit and force push, but this is not recommended. ## I need to add staged changes to the previous commit From cb168abd45f005a5f6ad60362b632822a527177b Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 4 Sep 2015 10:32:37 +0800 Subject: [PATCH 2/2] update comment. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a199f08..929cbc3 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ If you wrote the wrong thing and the commit has not yet been pushed, you can do $ git commit --amend ``` -The another way to change commit message: +Another way to change the commit message: ```sh $ git reset --soft HEAD^