rewrite git history
For this project, I built a pair of high-performance command-line tools in Go designed to safely manipulate and re-sign Git history—operations that are normally error-prone, slow, or require complex manual workflows. The goal was to provide developers with a fast, scriptable, and reliable way to rewrite authorship information and regenerate cryptographic commit signatures across entire repositories.
The project consists of two standalone binaries:
change-name
This tool streams a repo’s commit history through git fast-export → a custom transformation layer → git fast-import, allowing full control over identity metadata in commits. It supports:
- Rewriting author and committer names/emails
- Updating Signed-off-by lines
- Clean reconstruction of commit message blocks
- Optional automatic re-signing of rewritten commits
change-name is especially useful when migrating repositories, correcting historical identities, or enforcing consistent organizational metadata.
re-sign
The second binary focuses solely on signature regeneration. It rebuilds each commit using git commit-tree -S, preserving timestamps and parent relationships while producing a fully re-signed version of the entire commit DAG. This separation of concerns makes it safer to re-sign imported or rewritten histories, whether using GPG, SSH, or other signature mechanisms.
Why I built it
History rewriting in Git is powerful but risky, and existing tooling can be difficult to automate or customize. By writing these tools in Go, I was able to create a robust, stream-based architecture that avoids temporary repositories, handles large histories efficiently, and keeps the logic transparent and auditable. The binaries are built for developers who need precise control over repository lineage—maintainers, release engineers, and teams managing long-lived codebases.