Alright, today I'm going to talk about π a little fun trick. This is actually about how to increase your GitHub Contribution Graph. If you try this out, do not test it on your main GitHub account β it could have a negative impact. Instead, write a small code and run it. Here, I'll be writing the code in JavaScript. In this code, weβll go back to previous days and make Git commit messages appear as if they were done on those days. You can go back as many days as you like and customize it through the code. Once you run the code, your GitHub Contribution Graph will fill up for the reversed dates and go green π±.
To switch between GitHub accounts, go to π» Windows Control Panel, open π οΈ Credentials Manager, and remove the GitHub-related credentials under Windows Credentials. This is because we need to sign out from the GitHub account and log into the new account via a browser. Besides that, youβll need to remove your Git credentials. Then, set up the Git Bash Command Line again with git config --global user.name
and git config --global user.email
. Alternatively, you can generate an π SSH key and use it for multiple accounts π§βπ».
Here, I used const {execSync} = require('child_process')
to run shell commands. The code includes commands like git add
, git commit
, and git push
. These can be run in sequence by using this method.
I also used the π fs
module to create a file with βCommit forβ in it, which changes the date. When you run this code, youβll be able to see exactly how it works. Remember, try this out with a test account as it canβt be recovered if you do this on your main account β it could affect it. I created a test account just for fun and tried it out π
β and it worked π’!