Last active
January 14, 2022 02:29
-
-
Save chr15m/6840e81cf1b7eafbf7ffe051f77ed833 to your computer and use it in GitHub Desktop.
Count lines of code in your git repo
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
#!/bin/sh | |
# Count the lines of source code checked into your repository | |
# Requires the `cloc` command as a dependency. | |
# You can pass extra arguments to cloc like this: | |
# git cloc --exclude-dir=build --exclude-ext=js | |
git ls-tree -r `git branch | grep '^*' | colrm 1 2` --name-only | sed 's/.*/"&"/' | xargs cloc "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment