Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
How to find the last few commits (say "20" commits) to a git repository. git log shows all the commits, I just need the last few commits.
Lots of ways, all of them documented in the git-log man page.
git-log
Specify a -n or --max-count:
-n
--max-count
$ git log -n 20
Or, specify a range of commits in the form of <since>..<until>:
<since>..<until>
$ git log HEAD~20..HEAD
You can omit the <until> since it's HEAD:
<until>
$ git log HEAD~20..
Add a comment
instead of using git log -n 20, simply gitk --all & can see the structs and some detailed information.
git log -n 20
gitk --all &
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.