Automate cloning all your GitHub repositories, rewriting all commit emails, and force-pushing back to GitHub.
- Clone all repos (public & private) from your GitHub account
- Rewrite all commits from old email(s) to your new email (no-reply supported)
- Auto-force-push all history to GitHub
- Safe for personal/migration/bulk cleaning
-
Install GitHub CLI (gh) & jq:
gh auth login sudo apt install jq # or brew install jq -
Edit
rewrite-all-git-email.sh:- Set your GitHub username, old/new email, and target folder
-
Run the script:
chmod +x rewrite-all-git-email.sh ./rewrite-all-git-email.sh
- The script scans all repos, auto-clones if missing, rewrites all commit history, and pushes force to origin.
- Only use for repos you own or have permission to rewrite history.
WARNING: This tool rewrites git history and force-pushes to GitHub. Never use on repositories you do not fully control or collaborate on without all contributors’ consent.
MIT © NeaByteLab