Skip to content

Shineii86/CommitGraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Commit Graph Generator Banner

Open In Colab Python 3.8+ License: MIT

GitHub Stars GitHub Forks

A fully automated Python script that runs in Google Colab to generate backdated commits and customize your GitHub contribution graph.


Warning

This script creates backdated commits to artificially populate your GitHub contribution graph.

  • Use responsibly. Artificially inflating contributions may be viewed negatively by potential employers or collaborators who review your profile.
  • You need a GitHub Personal Access Token (classic) with repo scope to push commits.
  • The script force-pushes to your repository, overwriting its commit history. Use a dedicated, empty repository to avoid losing important work.
  • This tool is intended for educational purposes and personal experimentation only.

πŸ“– Table of Contents


🎯 What is This Tool?

This tool generates backdated commits over a specified date range, allowing you to customize the appearance of your GitHub contribution graph.

Two Modes Available:

  1. Random Commit Pattern – Creates a gradually increasing density of commits (ramp‑up effect) over a date range.
  2. 🎨 Custom Text Mode – Draws words like HELLO or GITHUB directly onto your contribution graph using a 5Γ—7 pixel font. Each letter is mapped to specific days, creating a clean, pixel‑art style message.

Common Use Cases:

  • Experimenting with Git's backdating capabilities for educational purposes.
  • Creating a specific visual pattern or message on your contribution graph for fun.
  • Understanding how GitHub's contribution tracking works.

Note

This tool does not unlock any GitHub achievement. It is purely a customization utility.


βœ… Why Use This Method?

Feature Benefit
☁️ No PC Required Runs entirely in Google Colab (cloud‑based). Works on any device with a browser.
πŸ“… Flexible Date Range Specify any start and end date for your commit pattern.
πŸ“ˆ Customizable Density Control the minimum and maximum commits per day.
🎨 Draw Text Spell words using the contribution graph's green squares.
πŸ” Fully Automated Clones, commits, and force-pushes automatically.
πŸ“¦ Minimal Dependencies Only uses GitPython and standard libraries.

🧰 Prerequisites

Before you begin, make sure you have:

  1. A GitHub account.
  2. An empty or dedicated repository where you have write access (create a new one to avoid losing real work).
  3. A GitHub Personal Access Token (Classic) with repo scope.

πŸ” How to Get a Personal Access Token

  1. Go to Settings β†’ Developer settings β†’ Personal access tokens β†’ Tokens (classic).
  2. Click Generate new token (classic).
  3. Give it a name (e.g., Commit Graph Generator).
  4. Under Select scopes, check repo (this grants full control of your repositories).
  5. Click Generate token and copy the token immediately β€” you won't see it again.

πŸ”’ Keep this token secret. Never share it with anyone or upload it to a public place.


πŸ“₯ How to Deploy

1️⃣ One‑Click Colab

Open In Colab

2️⃣ Fill in the Configuration Form

Inside the Colab notebook, you'll find a single configuration cell with form fields. Choose between the Random Pattern (default) and Custom Text Mode by toggling USE_CUSTOM_TEXT.

3️⃣ Run the Notebook

Click Runtime β†’ Run all (or press Ctrl+F9). The notebook will:

  • Install GitPython
  • Clone your repository
  • Generate backdated commits according to your chosen mode
  • Force-push the new history to GitHub

You'll see real‑time output like:

πŸ“… Commit Graph Generator for user 'Shineii86'
Repository: commit-graph-demo

🎨 Drawing text: "HELLO"
   Starting 0 week(s) after 2026-04-01
   3 commit(s) per pixel

πŸ“Œ 2026-04-01: 9 commits
πŸ“Œ 2026-04-02: 6 commits
...
βœ… Created commits on 21 days to spell "HELLO".

⏫ Pushing to remote...
βœ… Force push complete.

✨ Done! Your contribution graph will update shortly.
πŸ“Š Visit: https://github.com/Shineii86

4️⃣ View Your Contribution Graph

  1. Go to your GitHub profile: https://github.com/YOUR_USERNAME
  2. The contribution graph will update within a few minutes to reflect the new commits.

βš™οΈ Configuration Options

All parameters are adjustable directly in the Colab form. The form is divided into three sections: Common Settings, Custom Text Mode, and Random Pattern Mode.

Common Settings (Always Required)

Variable Description Example Value
GITHUB_USERNAME Your GitHub handle "Shineii86"
GITHUB_TOKEN Personal Access Token (keep secret!) "ghp_abc123..."
REPO_NAME Target repository (must exist under your account) "commit-graph-demo"
FORCE_PUSH Overwrite remote history (required) True
USE_CUSTOM_TEXT Toggle between Custom Text (True) and Random Pattern (False). False

πŸ“ˆ Random Commit Pattern

Used when USE_CUSTOM_TEXT = False. Creates commits with a linear ramp‑up in density.

Parameter Default Description
START_DATE "2026-04-01" First date to create commits.
END_DATE "2026-04-15" Last date to create commits.
MIN_COMMITS_START 0 Minimum commits on the first day.
MAX_COMMITS_START 5 Maximum commits on the first day.
MIN_COMMITS_END 5 Minimum commits on the last day.
MAX_COMMITS_END 10 Maximum commits on the last day.

Commit Density Logic
The script linearly interpolates the commit count ranges from start to end. For a constant density, set the start and end min/max values equal.


🎨 Custom Text Mode

Used when USE_CUSTOM_TEXT = True. Draws a word or phrase using the contribution graph as a canvas.

Parameter Default Description
CUSTOM_TEXT "HELLO" The word to draw. Supported characters: uppercase A-Z, digits 0-9, space, ., !, ?.
START_DATE "2026-04-01" The Sunday of the week where drawing begins (the script auto‑adjusts to Sunday if a different day is given).
TEXT_START_OFFSET_WEEKS 0 Number of empty weeks to skip after START_DATE before drawing the text (shifts the text to the right).
COMMITS_PER_PIXEL 3 How many commits to create for each "on" pixel. Higher numbers = darker green squares (max shade usually at 4–5 commits).

How Custom Text Works

  • Each character is rendered using a 5Γ—7 pixel font. The top row corresponds to Sunday, the bottom row to Saturday.
  • Characters are placed side‑by‑side with a 1‑column gap.
  • The script calculates the exact days that need commits and pushes them with backdated timestamps.

Example: Drawing "HI"

Setting Value
CUSTOM_TEXT "HI"
START_DATE "2026-04-05" (a Sunday)
COMMITS_PER_PIXEL 3

The result on your graph:

Sun Mon Tue Wed Thu Fri Sat
  β–ˆ  β–ˆ              β–ˆ  β–ˆ     ← 'H' (first week)
  β–ˆ  β–ˆ              β–ˆ  β–ˆ
  β–ˆ  β–ˆ              β–ˆ  β–ˆ
  β–ˆβ–ˆβ–ˆβ–ˆ              β–ˆβ–ˆβ–ˆβ–ˆ
  β–ˆ  β–ˆ              β–ˆ  β–ˆ
  β–ˆ  β–ˆ              β–ˆ  β–ˆ
  β–ˆ  β–ˆ              β–ˆ  β–ˆ

Sun Mon Tue Wed Thu Fri Sat
  β–ˆβ–ˆβ–ˆβ–ˆ                β–ˆβ–ˆ     ← 'I' (second week)
   β–ˆβ–ˆ                 β–ˆβ–ˆ
   β–ˆβ–ˆ                 β–ˆβ–ˆ
   β–ˆβ–ˆ                 β–ˆβ–ˆ
   β–ˆβ–ˆ                 β–ˆβ–ˆ
   β–ˆβ–ˆ                 β–ˆβ–ˆ
  β–ˆβ–ˆβ–ˆβ–ˆ                β–ˆβ–ˆ

πŸ’‘ Tip: Because GitHub contribution weeks start on Sunday, choose a START_DATE that is a Sunday for predictable alignment.


πŸ”¬ How It Works (Technical Overview)

The script performs the following steps:

  1. Clones the Repository: Uses your Personal Access Token to clone the specified repository into the Colab environment.
  2. Configures Git User: Sets the commit author and email to your GitHub identity.
  3. Generates Commits:
    • Random Mode: Iterates through each day, calculates a random number of commits, and creates them with backdated timestamps.
    • Custom Text Mode: Converts the input string to pixel coordinates, groups them by day, and creates the required number of commits per day.
  4. Force Pushes: Overwrites the remote repository's history with the new commit chain. This is necessary because backdating changes the commit timestamps, altering the existing history.

⚠️ Force push is destructive. It replaces the entire commit history on the remote branch. Always use a dedicated repository.


πŸ†˜ Troubleshooting

Issue Solution
github.GithubException.BadCredentialsException Your Personal Access Token is incorrect or expired. Generate a new one.
Permission denied or Authentication failed Ensure your token has the repo scope checked.
Repository not found Verify the repository name is correct and exists under your account.
Contribution graph not updating Wait a few minutesβ€”GitHub's graph updates are not instant. Also ensure the repository is public or that you've enabled private contributions in your profile settings.
GitCommandError: cannot push Make sure FORCE_PUSH is set to True. Backdated commits require force-pushing.
Commits appear on wrong dates Verify the date format is YYYY-MM-DD. For Custom Text mode, ensure START_DATE is a Sunday or let the script auto‑adjust.
Custom text characters are missing or misaligned Only uppercase letters, digits, and the symbols . ! ? are supported. The script will skip unsupported characters.

πŸ“„ License & Disclaimer

This project is licensed under the MIT License – see the LICENSE file for details.

Warning

This script is intended for educational purposes and personal experimentation only. Artificially inflating your contribution graph may be viewed negatively by potential employers or collaborators. The author is not responsible for any consequences arising from misuse of this tool, including but not limited to damage to professional reputation or violation of platform terms.


πŸ”— Quick Links


πŸ’• Loved My Work?

🚨 Follow me on GitHub

⭐ Give a star to this project

Banner

For inquiries or collaborations

Telegram Badge Instagram Badge Pinterest Badge Gmail Badge

Copyright Β© 2026 Shinei Nouzen All Rights Reserved

Last Commit

About

A fully automated Python script that runs in Google Colab to generate backdated commits and customize your GitHub contribution graph.

Topics

Resources

License

Stars

Watchers

Forks

Contributors