- 单行日志:
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 <Chenggang.Zhang@Honeywell.com>
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 <filename>
Git references: HEAD
git show HEAD当前状态
git statusgit log --oneline --graph
-git show
git show HEAD~ #same as HEAD~1 means parent.
git show HEAD~2 #parent's parentTAG
git tag
git show <tag name>
git tag <tagname> [<commit>]
git tag xxx HEAD^ # tag the previous commit