commit cbe1249b140dad24b2c35b15cc7e26a6f02d2277
Author:JerryMouse<jerry@tutorialspoint.com>Date:WedSep1108:05:262013+0530Implemented my_strlen function
commit 19ae20683fc460db7d127cf201a1429523b0e319Author:TomCat<tom@tutorialspoint.com>Date:WedSep1107:32:562013+0530Initial commit
Bash
Jerry使用–amend操作提交了新的更改,并查看了提交日志。
[jerry@CentOS project]git status -s
M string.c
??string[jerry@CentOS project]gitaddstring.c
[jerry@CentOS project]git status -s
M string.c
??string[jerry@CentOS project]git commit --amend -m 'Changed return type of my_strlen to size_t'[master d1e19d3]Changedreturntype of my_strlen to size_t1 files changed,24 insertions(+),0 deletions(-)
create mode 100644string.c
Bash
现在,git log 将显示新的提交消息和新的提交 ID −
[jerry@CentOS project]$ git log
Bash
上述命令将产生以下结果。
commit d1e19d316224cddc437e3ed34ec3c931ad803958
Author:JerryMouse<jerry@tutorialspoint.com>Date:WedSep1108:05:262013+0530Changedreturntype of my_strlen to size_t
commit 19ae20683fc460db7d127cf201a1429523b0e319Author:TomCat<tom@tutorialspoint.com>Date:WedSep1107:32:562013+0530Initial commit