Git系列3:Git查看历史提交信息

  • 单行日志:
    git-log --oneline -2
  • 图形记录
    $ git log --oneline --graph --all
  • 91ee5aa (HEAD -> master) Merge branch 'branch1'
    |
    | * ec70678 (branch1) branch1 modify
  • | 88a0812 (origin/master) switch to master
  • | d8d9cb0 Commit log
  • | 1ecdbdd (tag: add) init commit\r\n 1) by bruce
    |/
  • 98b5721 Nothing
  • 3f289ec Add filea.txt
  • 显示指定git id的提交信息
$ git show 3f28
commit 3f289ececf67f669d74e79b4222a5bfc5d04154d
Author: Bruce Zhang 
Date:   Mon Dec 23 15:21:43 2019 +0800

    Add filea.txt

diff --git a/filea.txt b/filea.txt
new file mode 100644
index 0000000..e69de29
  • 计算文件内容SHA-1: git hash-object

  • Git references: HEAD
    git show HEAD

  • 当前状态
    git status

  • git log --oneline --graph
    -git show
    git show HEAD~ #same as HEAD~1 means parent.
    git show HEAD~2 #parent's parent

  • TAG
    git tag
    git show
    git tag []
    git tag xxx HEAD^ # tag the previous commit

你可能感兴趣的:(Git系列3:Git查看历史提交信息)