Skip to content

Instantly share code, notes, and snippets.

@OzTamir
Created February 28, 2015 12:14
Show Gist options
  • Select an option

  • Save OzTamir/552fb4d6b913801fea67 to your computer and use it in GitHub Desktop.

Select an option

Save OzTamir/552fb4d6b913801fea67 to your computer and use it in GitHub Desktop.
Aliases to count lines and get statistics about a git project (requires CLOC: http://cloc.sourceforge.net)
# Set aliases
# Count lines in a git repository
alias git_lines='git ls-files | xargs wc -l'
# Count lines of code using CLOC
alias cloc='/Applications/CLI/cloc'
# Lines in a project
alias lines="echo 'Total Lines:' ; git_lines | tail -1 ; echo ''; echo 'Statistics:' ; cloc . | tail -8"
@OzTamir
Copy link
Author

OzTamir commented Feb 28, 2015

Assuming that the CLOC binary is at /Applications/CLI/cloc (on an OS X platform)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment