Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
227 views
in Technique[技术] by (71.8m points)

如何查看git前n次的commit id

现有一个git仓库,其git log 如下

commit 7c3b0a433fc13bb2c4761f7eabddc9ee6af0ac52 (HEAD -> master, origin/master, origin/HEAD)
Author: yimo <moyishi213@gmail.com>
Date:   Fri Aug 28 10:09:37 2020 +0800

    aaa

commit 352e0a1b40d3dc56eba7069241234fb58d650632
Author: yimo <moyishi213@gmail.com>
Date:   Thu Aug 27 20:11:00 2020 +0800

    bbb

commit bcf8af3ee1d1db0e20efd57a3b26bd8be2365bcb
Author: yimo <moyishi213@gmail.com>
Date:   Wed Jul 8 18:56:20 2020 +0800

    ccc

git rev-parse HEAD 可以获得最近一次的commit id,
7c3b0a433fc13bb2c4761f7eabddc9ee6af0ac52

如何获得前n次的git commit id?

git xxxx -n 2
352e0a1b40d3dc56eba7069241234fb58d650632

xxxx应该是什么?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (71.8m points)

git rev-parse HEAD~2

git-rev-parse


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
...