相关文章推荐
微醺的开水瓶  ·  git subtree pull 错误 ...·  1 月前    · 
个性的单杠  ·  git - git log ...·  1 月前    · 
光明磊落的路灯  ·  对于 Git ...·  1 月前    · 
坏坏的猕猴桃  ·  c++使用 ShellExecute ...·  1 年前    · 
爱跑步的柳树  ·  freeswitch 通道变量 ...·  1 年前    · 
帅呆的烤地瓜  ·  Android ...·  1 年前    · 
git commit -am "修改了一下"
复制代码
 [dev 88a4aa8] 修改了一下
 8 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 web/src/main/java/com/hello/web/DemoController.java
复制代码

此时看到的提交信息是:“修改了一下” 接下来我们来修改这个提交信息。

使用命令:

git commit --amend
复制代码

出现如下界面:

修改了一下
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Date:      Mon Apr 29 09:38:58 2019 +0800
复制代码

对提交信息修改如下:

添加查找图书功能
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Date:      Mon Apr 29 09:38:58 2019 +0800
复制代码

保存如下:

➜  blog git:(dev) git commit --amend
 [dev b201317] 添加查找图书功能
 Date: Mon Apr 29 09:38:58 2019 +0800
 8 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 web/src/main/java/com/hello/web/DemoController.java
复制代码

这样就改好了,commit的id也会跟着改变.

小飞2020
私信