
I built git-greener to solve a problem most developers have faced at least once: you leave a job, switch GitHub accounts, or consolidate profiles, and suddenly years of contribution history just… disappears.
Your GitHub contribution graph tells a story. It reflects consistency, dedication, and the work you’ve put in over time. Losing that when you move on never sat right with me, so I decided to build something about it.
git-greener is a Node.js CLI tool that lets you replay commit history from one repository into another while preserving the original dates. The key distinction here is that only commit metadata transfers — dates and subject lines. No source code is ever moved. This keeps things clean, respects intellectual property, and focuses purely on preserving your contribution footprint.
The workflow is two commands:
Point extract at any local git repo and it reads the commit log, outputting a pipe-delimited metadata file.
npx git-greener extract --source ./my-old-project --output ./commits.txt
You can filter by author email, date range, or branch to grab exactly the commits you care about.
Take that metadata file and replay it into a target repository. git-greener creates empty commits with the original timestamps preserved.
npx git-greener replay --input ./commits.txt --target ./my-contribution-repo
Each replayed commit uses GIT_AUTHOR_DATE and GIT_COMMITTER_DATE to maintain the original dates on GitHub’s contribution graph.
I was deliberate about making this tool safe by default:
--execute--redact flag strips commit messages entirely if you’re working with sensitive codebasesThis tool is for anyone who has experienced that moment of losing their green squares:
No install required. Just run it with npx (Node.js 20+ needed):
npx git-greener extract --source ./repo --output ./commits.txt
npx git-greener replay --input ./commits.txt --target ./target-repo --execute
Always dry-run first, filter to only your commits, and check your employer’s policies around commit metadata before using it.
The full source and documentation are on GitHub:
I’d love to hear feedback or see contributions. Give it a try and bring your green with you.