I look this up every once in a while and always end up searching for the command.Git Bash — cd into the Git project you want to count, then run the command below. Change the start and end dates to the actual time range you need.SHgit log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --since ==2024-07-08 --until=2024-08-08 --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
Git commands for counting lines
I look this up every once in a while and always end up searching for the command.
Git Bash —
cdinto the Git project you want to count, then run the command below. Change the start and end dates to the actual time range you need.