Git Developer Quantitative Analysis Report (Audit)

MD
R
Markdown

Compact Git Cheatsheet for Quantitative Analysis

Commit Impact & Analysis Commits with stats: git log --stat --author="xpto" --since="2023-12-01" --until="2023-12-31" Total commit count: git rev-list --count --all --author="xpto" --since="2023-12-01" --until="2023-12-31"

Line Counts Lines added: git log --author="xpto" --since="2023-12-01" --until="2023-12-31" --pretty=tformat: --numstat | awk '{ add += $1 } END { print add }' Lines removed: git log --author="xpto" --since="2023-12-01" --until="2023-12-31" --pretty=tformat: --numstat | awk '{ remove += $2 } END { print remove }' Net lines changed: git log --author="xpto" --since="2023-12-01" --until="2023-12-31" --pretty=tformat: --numstat | awk '{ add += $1; remove += $2 } END { print add - remove }'

Advanced Queries Lines changed per file: git log --numstat --pretty="%H" --author="xpto" --since="2023-12-01" --until="2023-12-31" Visualize changes: git log --stat --graph --author="xpto" --since="2023-12-01" --until="2023-12-31" Search content changes: git log -S"<content>" --since="2023-12-01" --until="2023-12-31" Analyze a commit: git show --stat <commit-hash>

Day by Day stats for d in {16..25}; do date="2024-09-$d" count=$(git log --author="xptoa" --since="$date 00:00:00" --until="$date 23:59:59" --oneline | wc -l) echo "$date: $count" done

Created on 1/31/2024