Last active
March 31, 2022 09:05
-
-
Save ManiruzzamanAkash/171c5b412431f2fb31c10a43e585c48c to your computer and use it in GitHub Desktop.
Git commands Lines of Code and Commit For a Year Range
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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