Skip to content

Instantly share code, notes, and snippets.

@anvit
Created December 9, 2022 22:26
Show Gist options
  • Save anvit/faa84d7beb9990c7ab20ed10be0ee9aa to your computer and use it in GitHub Desktop.
Save anvit/faa84d7beb9990c7ab20ed10be0ee9aa to your computer and use it in GitHub Desktop.
Generate diffs for every author in a git repo
#!/bin/bash
read -p "Enter repo url: " url
git clone $url && cd "$(basename "$_" .git)"
mkdir -p ../diffs
git log --format='%aN' | sort -u | xargs -I % sh -c 'git log --author "%" -p > "../diffs/%.diff"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment