Podcast Title

Author Name

0:00
0:00
Album Art

How to Ethically Manipulate Your GitHub Contribution Graph

By 10xdev team July 07, 2025

Perhaps you've been too busy for open source, or your GitHub account is just sitting there and gathering dust while you 'concentrate' on finishing college. In this article, I'll teach you how to transform your contribution graph from a sparse landscape to a vibrant one.

Understanding GitHub's Contribution Tracking

Before diving into the code, let us understand how GitHub stores data when a commit happens. When you create commits in your repositories, each commit is associated with timestamps. In this tutorial, we will automate numerous commits and link them to past dates so GitHub recognizes them as contributions that you made in the past. I'll also teach you how you can create pixel art on your GitHub profile.

A Quick Disclaimer

Note: This content is intended solely for educational purposes and to show how easy it is to fake your profile on the internet. I do not endorse using it to gain an unfair advantage over others.

Setting Up the Project

The first thing you want to do is create a private GitHub repository. You can do this by going to github.com. Once you have your repository, clone it in your favorite code editor.

Now, initialize a Node.js project and create a JavaScript file.

npm init -y

Next, create another JSON file to store all the commit timestamp data. To use ES modules instead of CommonJS, add the following to your package.json:

{
  "type": "module"
}

We'll use several npm modules. Install them with this command. I'll explain their use as we code.

Making Your First Commit

First, import the necessary modules. Define constants for the JSON file path and the current timestamp formatted as GitHub expects. moment.format basically returns that timestamp that we need. Then, prepare the data object to be written to the JSON file.

Next, use json.writeFile to write the data to your JSON file. It accepts the file path and the data as parameters. Run the file to confirm that data.json is populated.

With the data file ready, the next step is to create commits and push them to the remote repository. For this, we'll use the simple-git module. Install it using this command:

npm install simple-git

Now, import it into your script. To create a commit, use the methods provided by simple-git. simple-git.add() takes an array of files to be staged. In our case, it will be our JSON file. The .commit() method takes the commit message as its first parameter; we'll use the date for this, as this is how it internally stores commits. Finally, the .push() method sends these changes to your remote repository.

After running the script, you will see the file pushed to your repository with a new commit for the current date.

Committing to the Past

Now that we're able to make commits, let's make a commit to yesterday. This is possible using the moment().subtract() method, which can subtract days, months, or even weeks or years from any timestamp.

Also, it's always a good practice to use asynchronous functions when dealing with file reads and writes. In this situation, we can add a callback function as the third parameter to writeFile and trigger the push only after a successful file write.

Creating Contribution Graph Art

Now that we can manipulate dates, we can take this a step further by pinpointing commits to specific X and Y coordinates on the contribution graph. For example, to make a commit in the top-left corner of the graph (representing the beginning of the year), we can target the coordinates (0, 0).

The code to achieve this looks like this:

const markCommit = (x, y) => {
  // ... logic to subtract weeks (x) and days (y)
};

The key change is the addition of two parameters to our function. By adding X weeks, we move horizontally across the graph, and by adding Y days, we move vertically. Running markCommit(2, 3) will create a commit at the specified coordinate.

Using this method, you can programmatically 'draw' on your contribution graph, spelling out your name or creating any pixel art you desire.

Note: You can also control the color gradient. The more commits you make on the same day, the darker the shade of green will be.

You could even build a script to convert an input string into a corresponding X-Y mapped contribution graph.

Generating a Realistic-Looking Graph

And now, for the exciting part: to generate a contribution graph that appears authentic, we can modify our function to create commits on random dates. This requires the random npm module, so be sure to import it.

The logic here is to randomly generate coordinates within the 54 weeks and 7 days of the contribution graph. For efficiency, it's better to avoid pushing after every single commit. Instead, we can remove the push from the loop and perform a single push after all local commits have been created.

A base condition is necessary to terminate the recursion. The following code will push all commits once the termination condition is met:

// Base condition for recursion
if (n === 0) {
  simpleGit().push();
  return;
}

Running this script will create over 90+ commits in your repository. You can adjust the number of commits to control the density of the graph. Adding more commits will progressively fill out the graph, making it look more active.

Final Configuration

Important: Ensure the 'Show Private Contributions' option is enabled in your GitHub profile settings. Otherwise, these commits from your private repository will not be visible.