本文介绍了在git中记录第一个10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有两个问题:
Two questions:
- 如何从头到尾显示git中的前10个提交。 (无分支)
- 如何指定提交索引并记录它。 (显示第二个或第三个)
我知道git使用parent来链接提交,很容易将提交从结尾记录到开始。
like: git log HEAD〜10
I know that git use parent to link the commit, it's easy to log the commit from end to start.like: git log HEAD~10
但是我需要从头到尾进行查询,是否有可能?
But i need to query from the start to end, is it possible?
推荐答案
只需使用一种线路格式记录所有内容,并输出结果即可:
Simply log everything with one line format and tail the output:
git log --pretty=oneline | tail -n 10
这篇关于在git中记录第一个10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!