Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 976 Bytes

view-last-commit.md

File metadata and controls

23 lines (17 loc) · 976 Bytes
标题 标签
viewLastCommit(查看 git 的上一次提交) commit(提交)

检查最后一次 Git 提交的内容有时有助于了解存储库的历史记录。git log 命令可以通过显示存储库中的最后一次提交来帮助你实现这一点。

使用 git log -1,你可以查看存储库中的最后一次提交。此命令将显示最后一次提交的提交哈希、作者、日期和提交消息。你可以使用箭头键浏览提交历史记录,然后按 Q 退出。

代码如下:

# 语法: git log -1

使用示例:

git log -1
# commit 80398d541e707c28d9262a807627cc4cdc40259f (HEAD -> main, origin/main, origin/HEAD)
# Author: eveningwater <854806732@qq.com>
# Date:   Mon Sep 23 01:51:34 2024 +0000
#     feat: '实现类似 js 中 eval 方法'示例添加了ts代码段