HomePostsProjects

Useful Git Commands

May 30, 2022

  • https://levelup.gitconnected.com/7-lesser-known-git-commands-and-tricks-9915e9caeb70

Commands:

# contributors
git shortlog -sn
git shortlog -sn | head -3
 
# current commit hash
git rev-parse HEAD
 
# viewing diffs
git diff *.txt
git diff HEAD~2 HEAD~1
 
# git logs
git log --author="John Smith" --oneline
 
# git show
git show
git show HEAD~3
git show commit:path/to/file

© 2025 Luke Miloszewski

Email AddressGitHubTwitter