This CLI tool allows you to sync GitHub contributions by generating commit scripts based on the contribution history of a GitHub user. Ideal for merging commit histories from different accounts into one visual contribution graph.
- Fetch Contribution History: Retrieves contribution history from any GitHub user.
- Generate Commit Scripts: Creates a shell script to replicate the commits locally.
- Avoid Duplicate Commits: Ensures that existing commits are not duplicated.
- Unique Commit Messages: Each commit has a unique message to avoid conflicts.
Follow these steps to get started:
-
Clone the repository:
git clone git@github.com:isturiz/sync-graph.git
-
Navigate to the project directory:
cd sync-graph
-
Install dependencies:
pnpm install
Run the CLI with:
pnpm start
or for Node.js version 22 and above:
node --run start
You will be prompted to enter the GitHub username, the minimum year, and the maximum year for fetching contributions. Additionally, you can decide whether to execute the script immediately or not.
- Execute Immediately: If you choose
yes
, the commits will be generated and executed immediately. - Generate Script Only: If you choose
no
, the commits will be generated in thescript.sh
file for manual execution later.
Once the script has been executed or generated, you can push the changes to your GitHub repository with:
git push origin main
This project was inspired by the work of charpeni in sync-external-contributions. However, since the original project is no longer maintained and doesn't work as of today, I created this project to fulfill the same need.