Untitled
This is a list of git tricks I’ve found randomly on the Internet that could be helpful.
Amend any commit hash with
# .gitignore
[alias]
fixup = "!f() { TARGET=$(git rev-parse $1); git commit --fixup=$TARGET ${@:2} && GIT_SEQUENCE_EDITOR=true git rebase -i --autostash --autosquash $TARGET^; }; f"running git fixup <SHA-1>.
Repo analysis
Most 20 changes files in last year
git log --format=format: --name-only --since="1 year ago" | sort | uniq -c | sort -nr | head -20Number of commits per developer
git shortlog -sn --no-mergesWhich files are broken the most
git log -i -E --grep="fix|bug|broken" --name-only --format='' | sort | uniq -c | sort -nr | head -20