美文网首页
Git查看提交历史

Git查看提交历史

作者: 走过分叉路 | 来源:发表于2019-12-18 10:39 被阅读0次

不带参数的log命令

$ git log
commit ca82a6dff817ec66f44342007202690a93763949 (HEAD -> master, origin/master, origin/HEAD)
Author: Scott Chacon <schacon@gmail.com>
Date:   Mon Mar 17 21:52:11 2008 -0700

    changed the verison number

commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
Author: Scott Chacon <schacon@gmail.com>
Date:   Sat Mar 15 16:40:33 2008 -0700

    removed unnecessary test code

commit a11bef06a3f659402fe7563abf99ad00de2209e6
Author: Scott Chacon <schacon@gmail.com>
Date:   Sat Mar 15 10:31:28 2008 -0700

    first commit

git log --prety=format常用的选项

image.png

示例:显示作者的电子邮件地址,提交者的名字, 提交说明

$ git log --pretty=format:"%ae, %cn, %s"
schacon@gmail.com, Scott Chacon, changed the verison number
schacon@gmail.com, Scott Chacon, removed unnecessary test code
schacon@gmail.com, Scott Chacon, first commit

git log的常用选项

image.png

示例:显示新增、修改、删除的文件清单

$ git log --name-status
commit ca82a6dff817ec66f44342007202690a93763949 (HEAD -> master, origin/master, origin/HEAD)
Author: Scott Chacon <schacon@gmail.com>
Date:   Mon Mar 17 21:52:11 2008 -0700

    changed the verison number

M       Rakefile

commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
Author: Scott Chacon <schacon@gmail.com>
Date:   Sat Mar 15 16:40:33 2008 -0700

    removed unnecessary test code

M       lib/simplegit.rb

commit a11bef06a3f659402fe7563abf99ad00de2209e6
Author: Scott Chacon <schacon@gmail.com>
Date:   Sat Mar 15 10:31:28 2008 -0700

    first commit

A       README
A       Rakefile
A       lib/simplegit.rb

git log限制输出长度

限制git log输出的选项 image.png

示例:提交对象的简短的哈希字符串 - 提交说明,过滤时间是2006-10-01到2018-11-01期间,提交但未合并的记录

$ git log --pretty="%h - %s" --since="2006-10-01" --before="2018-11-01" --no-merges -- t/

相关文章

  • 2016-07-13 Git 基础(三)

    Git 基础 - 查看提交历史 查看提交历史 git log 如果不带任何参数的话,会按照提交时间列出所有的更新。...

  • Git 基础 - 查看提交历史

    查看提交历史 git log 命令用于查看提交历史 默认不使用参数的话,git log 会按提交时间列出所有的更新...

  • git版本控制

    查看提交历史 git log 如果想要查看git的提交历史,可以使用git log命令。本文会介绍一些常用的命令选...

  • git 回滚到之前某一commit

    git log 查看提交历史 git reset --hard HEAD引用指向给定提交,...

  • log查看纪录

    查看提交历史 git log 查看提交纪录 默认不用任何参数的话,git log 会按提交时间列出所有的更新,最近...

  • git 查看历史

    Git 查看提交历史 一、查看所有历史 git log 二、显示每次提交所引入的差异(按补丁的格式输出)。 你也可...

  • 历史

    查看提交日志:git log单行历史:git log --pretty=oneline

  • git学习总结

    git status:掌握工作时区状态 git diff:查看修改的内容 git log:查看提交历史 git r...

  • git 常用指令步骤

    git status 查看状态git log 查看提交历史git add . 跟踪所有改动过的文件git com...

  • Git查看提交历史

    不带参数的log命令 git log --prety=format常用的选项 示例:显示作者的电子邮件地址,提交者...

网友评论

      本文标题:Git查看提交历史

      本文链接:https://www.haomeiwen.com/subject/nmvynctx.html