Skip to content

Instantly share code, notes, and snippets.

@aptitudepi
Last active March 16, 2024 06:10
Show Gist options
  • Save aptitudepi/e783b5015b7124ba21307742585469cd to your computer and use it in GitHub Desktop.
Save aptitudepi/e783b5015b7124ba21307742585469cd to your computer and use it in GitHub Desktop.
Use gh cli and git to rewrite commit history and anonymize commits
# pip3 install git-filter-repo
gh repo list --json name -q '.[].name' --limit 1000 | while read -r repo; do ─╯
gh repo clone "$repo"
cd "$repo"
git-filter-repo --email-callback 'return email.replace(b"old@email.com", b"new@email.com")'
git push
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment