Skip to content

Instantly share code, notes, and snippets.

@reloni
Last active April 22, 2021 09:44
Show Gist options
  • Save reloni/15837f2b773d1c8df43160b4ca923729 to your computer and use it in GitHub Desktop.
Save reloni/15837f2b773d1c8df43160b4ca923729 to your computer and use it in GitHub Desktop.
Git tricks
Get git commit history for period:
git log --oneline --no-merges --after="2019-C10-01" --until="2019-10-31" --author="Anton Efimenko" --format="%s"
Unique commit messages:
git log --oneline --no-merges --after="2019-C10-01" --until="2019-10-31" --author="Anton Efimenko" --format="%s" | uniq
commits count by author:
git shortlog -s -n --all --no-merges
download github branch archive:
wget https://github.com/reloni/goexample/archive/master.zip && unzip -o master.zip -d ./gotest && rm -f master.zip
List lines added/removed by user:
git log --author="Anton Efimenko" --pretty=tformat: --numstat | grep -v '^-' | awk '{ add+=$1; remove+=$2 } END { print "Added: ", add, "Removed: ", remove }'
# enable credential helper
git config --global credential.helper store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment