Skip to content

Instantly share code, notes, and snippets.

View pdroalves's full-sized avatar

Pedro Alves pdroalves

View GitHub Profile
@pozorvlak
pozorvlak / git-anonymize
Last active August 8, 2024 11:53
Anonymise Git history
#!/bin/sh
# Suppose you want to do blind reviewing of code (eg for job interview
# purposes). Unfortunately, the candidates' names and email addresses are
# stored on every commit! You probably want to assess each candidate's version
# control practices, so just `rm -rf .git` throws away too much information.
# Here's what you can do instead.
# Rewrite all commits to hide the author's name and email
for branch in `ls .git/refs/heads`; do