git log 命令可以列出当前分支的所有提交历史记录,包括每个提交的 SHA-1 标识符、作者、日期、提交信息等。默认情况下,它按时间顺序列出这些提交。
下面是一个示例 git log 命令输出:
commit 5f5a52e16716b2072a3ba3b7d6c5c95a9d90aee8
Author: John Doe <johndoe@example.com>
Date: Thu May 13 15:24:56 2021 -0700
Updated README with new instructions.
commit b35d6dd640a43d22a97a08f6ed1634e45998be3c
Author: Jane Smith <janesmith@example.com>
Date: Wed May 12 11:09:38 2021 -0700
Added a new feature to the app.
commit 8b26e3efa3a64228b80c9ce8be0d07435ab32a08
Author: John Doe <johndoe@example.com>
Date: Tue May 11 18:51:06 2021 -0700
Fixed bug in login form.
...
这里每个提交都以 commit 开头,并跟随其 SHA-1 标识符。每个提交都有一个作者和提交日期。提交消息则给出了该提交的详细信息。