Search This Blog

git: count total number of lines

  • Method 1:
    git ls-files | xargs wc -l

    or count only .java files:
    git ls-files | grep '.java$' | xargs wc -l
  • Method 2:
    git diff --stat $(git hash-object -t tree /dev/null)

No comments:

Post a Comment