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.
- 2024-10-20: Now the commits use 'No.' to express the number of commits instead of the '#' character to avoid conflicts with repository issues. -
- 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:
-
Use the "Use template" button
-
Clone the repository:
git clone your_repository_from_template
-
Navigate to the project directory:
cd your_repository
-
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.