How can I achieve? git log -n20 Also, I have many projects in a single repo so I want to filter by directory git log -n20 -- .