The 'count-lines.sh' script is a powerful Bash tool designed to analyze Git repositories and calculate the total number of files changed, lines inserted, and lines deleted by a specified author over a given time period. By traversing a folder containing one or multiple Git repositories, it aggregates commit statistics using `git log --shortstat`, supporting both single repositories and nested directory structures. With robust error handling, cross-platform date calculations, and the ability to filter by author name or email (including multiple emails via regex), it provides detailed per-repository and summary reports. Ideal for developers and teams, this script helps track individual contributions across projects efficiently.
./count-lines.sh ~/Dev 90 'your_github_email@email.com\|your_other_github_email@email.com'
This will count lines changed by either email address in any git repositories found in the ~/Dev directory over the last 90 days.