Question:
Two questions:
- How to show the first 10 commit in git from beginning to end. (no branch)
- How the specify the commit index and log it. (show the second or third)
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?
Answer:
Simply log everything with one line format and tail the output:
1 2 |
git log --pretty=oneline | tail -n 10 |