Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ManiruzzamanAkash/171c5b412431f2fb31c10a43e585c48c to your computer and use it in GitHub Desktop.
Save ManiruzzamanAkash/171c5b412431f2fb31c10a43e585c48c to your computer and use it in GitHub Desktop.
Git commands Lines of Code and Commit For a Year Range
// Get Commit for a Year ==> 2021 Jan 01 to 2021 Dec 31
git rev-list --all --count --since="01 Jan 2021" --before="31 Dec 2021"
// Get Lines of Code for a Year ==> 2021 Jan 01 to 2021 Dec 31
git log --since=2021-01-01 --until=2021-12-31 --format= --numstat | awk '{s+=$1; s+=$2} END {print s}'
// Get Lines of Code for a repository File by File
git ls-files | xargs file | grep "ASCII" | cut -d : -f 1 | xargs wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment