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 ๐ข!