Boosting Your GitHub Contribution Graph: A Fun Trick with JavaScript πŸš€πŸŒ±

kavindu praneeth - Nov 3 - - Dev Community

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 🟒!

Code-https://github.com/kavindu724

Image description

.
Terabox Video Player