Last active
September 28, 2023 11:45
-
-
Save valllllll2000/224810c6f9bb0f6e6e41a31ac39d27d4 to your computer and use it in GitHub Desktop.
Useful git commands
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
#Pretty and comprehensive git log | |
# see https://git-scm.com/docs/git-log#_commit_formatting for options | |
git log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%an%C(reset)%C(bold yellow)%d%C(reset) %C(dim white)- %s%C(reset)' --all | |
#display stats about a commit | |
# see https://git-scm.com/docs/git-show | |
git show b1e7dcb0204d1eab337d0ff7b41a3e53441ed2bc --stat | |
#show changes for a file | |
git show <commit> -- <filepath> | |
#number of lines of code in a folder | |
git ls-files | xargs wc -l | |
# same a above but by filetype | |
git ls-files | grep '\.js' | xargs wc -l | |
#tags | |
git tag -a v1.4 -m "my version 1.4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment