Skip to content
Justice Tech School

Shortlog and git grep

git shortlog -sn counts commits per author. git grep searches tracked files fast and can show line numbers.

Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
echo hello > h.txt && git add h.txt && git commit -qm 'Add hello'
git shortlog -sn HEAD
git grep -n hello

Result

     2	Ada
h.txt:1:hello

Exercise

Search tracked files.

git  hello

Quiz Test

Which command counts commits per author?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.