Git 查看提交历史

Git详述:https://mp.youkuaiyun.com/mp_blog/creation/editor/119935707

Git 安装配置:https://blog.youkuaiyun.com/li6472/article/details/119935707

Git 工作流程:https://mp.youkuaiyun.com/mp_blog/creation/editor/119945322

Git 工作区、暂存区和版本库:https://mp.youkuaiyun.com/mp_blog/creation/editor/119945402

Git 创建仓库:https://mp.youkuaiyun.com/mp_blog/creation/editor/119948151

Git 基本操作:https://mp.youkuaiyun.com/mp_blog/creation/editor/119949390

Git 分支管理:https://mp.youkuaiyun.com/mp_blog/creation/editor/119951024

Git 标签:https://mp.youkuaiyun.com/mp_blog/creation/editor/119951922

Git 远程仓库(Github):https://mp.youkuaiyun.com/mp_blog/creation/editor/119952396

Git Gitee:https://mp.youkuaiyun.com/mp_blog/creation/editor/119953973

Git 服务器搭建:https://mp.youkuaiyun.com/mp_blog/creation/editor/119954105

Git 提交历史一般常用两个命令:

  • git log - 查看历史提交记录。
  • git blame <file> - 以列表形式查看指定文件的历史修改记录。

git log

$ git log --reverse --oneline

我们可以用 --oneline 选项来查看历史记录的简洁的版本。

$ git log --oneline
$ git log --oneline
d5e9fc2 (HEAD -> master) Merge branch 'change_site'
c68142b 修改代码
7774248 (change_site) changed the runoob.php
c1501a2 removed test.txt、add runoob.php
3e92c19 add test.txt
3b58100 第一次版本提交

你也可以用 --reverse 参数来逆向显示所有日志。

$ git log --reverse --oneline

如果只想查找指定用户的提交日志可以使用命令:git log --author , 例如,比方说我们要找 Git 源码中 Linus 提交的部分:

$ git log --author=Linus --oneline -5

 更多 git log 命令可查看:http://git-scm.com/docs/git-log

git blame

  • 如果要查看指定文件的修改记录可以使用 git blame 命令,格式如下:
    git blame <file>

    git blame 命令是以列表形式显示修改记录,如下实例:

    $ git blame README 
    ^d2097aa (tianqixin 2020-08-25 14:59:25 +0800 1) # Runoob Git 测试
    db9315b0 (runoob    2020-08-25 16:00:23 +0800 2) 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值