A powerful tool to generate custom contribution patterns on your GitHub profile by creating backdated commits for any date range you choose.
- Overview
- Features
- Requirements
- Setup Instructions
- Installation
- Usage
- Command Reference
- Troubleshooting
- Contributing
- License
- Contact
- FAQ
This tool allows you to customize your GitHub contribution graph by generating commits with specified dates. Whether you need to:
- Fill in gaps in your contribution history
- Create artistic patterns
- Backdate commits for projects you worked on offline
- Generate a rich contribution history
- Custom Date Ranges: Generate commits for any time period
- Adjustable Commit Frequency: Set minimum and maximum commits per day
- Parallel Processing: Fast generation using multithreading
- Chronological Ordering: Commits are ordered by timestamp for each day
- Simple Setup: Easy-to-follow instructions for all skill levels
- Cross-Platform: Works on Windows, macOS, and Linux
- Python 3.6 or higher
- Git installed and configured
- GitHub account
- Personal Access Token with repository permissions
- Go to GitHub and log in
- Click the "+" icon in the top right corner, then select "New repository"
- Name the repository whatever you want (e.g., "my-contribution-history")
- Add a brief description
- Choose Public or Private based on your preference
- DO NOT initialize with README, .gitignore, or license
- Click "Create repository"
- Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Note: "Contribution Generator"
- Select scopes: check "repo" (Full control of private repositories)
- Click "Generate token"
- IMPORTANT: Copy your token immediately! You won't be able to see it again.
# Create a new directory for your activity repository
mkdir my-activity-repo
cd my-activity-repo
# Initialize git
git init
# Configure git with your details
git config user.name "YourUsername"
git config user.email "[email protected]"
# Create a README file
echo "# My Contribution History" > README.md
# Set up the remote repository
git remote add origin https://github.com/YourUsername/my-contribution-history.git
# Create the contribution script (copy the provided script to local_contribute.py)
# Use a text editor to paste the script contents
# Add your files
git add README.md local_contribute.py
git commit -m "Initial setup"
# Configure your PAT
git remote set-url origin https://[email protected]/YourUsername/my-contribution-history.git
- Clone this repository
# Clone this repository
git clone https://github.com/ascender1729/github-contribution-generator.git
# Copy the script file to your project
cp github-contribution-generator/local_contribute.py .
- Set up your target repository
# Create a new directory for your activity
mkdir my-activity-repo
cd my-activity-repo
# Initialize git
git init
# Configure git with your details
git config user.name "YourUsername"
git config user.email "[email protected]"
# Copy the script from the cloned repository
cp ../github-contribution-generator/local_contribute.py .
# Create a README file
echo "# My Contribution History" > README.md
# Add your remote repository
git remote add origin https://github.com/YourUsername/my-contribution-history.git
# Add your files
git add README.md local_contribute.py
git commit -m "Initial setup"
# Add your PAT to the remote URL (replace with your actual token)
git remote set-url origin https://[email protected]/YourUsername/my-contribution-history.git
- Run the script
python local_contribute.py
-
Enter requested information
- Start date (YYYY-MM-DD format)
- End date (YYYY-MM-DD format)
- Minimum commits per day (8-100)
- Maximum commits per day (must be ≥ minimum)
-
Wait for completion
- The script will show progress updates
- Generation may take from minutes to hours depending on date range
-
Push to GitHub
git push -f origin main
- View your GitHub profile
- Visit your profile to see the updated contribution graph
- Changes usually appear within a few minutes
Command | Description |
---|---|
git init |
Initialize a new Git repository |
git config user.name "YourUsername" |
Set your Git username |
git config user.email "[email protected]" |
Set your Git email |
git remote add origin URL |
Connect to remote repository |
git remote set-url origin URL |
Update remote repository URL (for PAT) |
git add . |
Stage all files for commit |
git commit -m "Message" |
Commit staged files |
python local_contribute.py |
Run the contribution script |
git push -f origin main |
Force push changes to GitHub |
-
"Error: remote origin already exists"
git remote remove origin git remote add origin https://github.com/YourUsername/repo-name.git
-
"Permission denied" when pushing
- Check that you've correctly added your PAT to the remote URL
git remote set-url origin https://[email protected]/YourUsername/repo-name.git
-
Encoding errors with emoji
- Use the script with
encoding='utf-8'
as provided - If errors persist, modify script to remove emoji characters
- Use the script with
-
Script runs too slowly
- Adjust the
chunk_size
andmax_workers
variables in the script - Try a smaller date range or fewer commits per day
- Adjust the
To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -m 'Add YourFeature'
). - Push to the branch (
git push origin feature/YourFeature
). - Create a new Pull Request.
Distributed under the MIT License. See LICENSE
for more information.
Pavan Kumar - [email protected]
LinkedIn: linkedin.com/in/im-pavankumar
Project Link: GitHub Contribution Generator
Q: Is this against GitHub's terms of service?
A: GitHub does not explicitly prohibit backdated commits. However, use this tool responsibly and ethically.
Q: Will this affect my GitHub streaks?
A: Yes, GitHub counts all commits regardless of date.
Q: Can I use this with private repositories?
A: Yes, the tool works with both public and private repositories.
Q: How can I create specific patterns?
A: Create multiple repositories with different date ranges to build specific patterns.
Q: Will my commits appear immediately?
A: GitHub typically updates contribution graphs within minutes, but it can sometimes take longer.
Disclaimer: This tool is meant for educational purposes. Use responsibly and ethically.