This script allows you to map a word onto your GitHub contribution graph by making commits with past dates. It creates a visual representation of the word on your contribution graph without the need for scheduled tasks.
- Custom Word Mapping: Input any word (using uppercase letters A-Z) to create custom patterns on your GitHub contribution graph.
- Immediate Execution: Makes all necessary commits immediately with past dates.
- Automated Commits: Commits are made on specific past dates to form the desired word.
Before you begin, ensure you have met the following requirements:
- Git Installed: Git must be installed on your computer. You can download it from git-scm.com.
- GitHub Account: You have a GitHub account. If not, you can sign up at github.com.
- GitHub Repository: You have a GitHub repository where you can push changes.
- SSH Keys (Recommended): Set up SSH keys for authentication with GitHub to avoid entering your username and password each time you push changes.
- Bash Shell: The script is written in Bash. You'll need a Unix-like environment to run it:
- macOS and Linux Users: Use the Terminal application.
- Windows Users: Use Git Bash (comes with Git for Windows) or Windows Subsystem for Linux (WSL).
Follow these instructions to set up the script and map your desired word onto your GitHub contribution graph.
Open your terminal or command prompt and clone your GitHub repository to your local machine, or navigate to your existing local repository.
# Replace with your actual repository URL
git clone git@github.com:yourusername/yourrepo.git
cd yourrepoYou need to make the script executable so you can run it.
macOS and Linux Users In your terminal, run:
chmod +x map_word.shWindows Users If you're using Git Bash or WSL, you can run the same command:
chmod +x map_word.shThe script commits changes to a file named dummy_file.txt. Create this file:
touch dummy_file.txtAdd the script and dummy file to your repository and make your first commit.
git add map_word.sh dummy_file.txt
git commit -m "Add mapping script and dummy file"Push your initial commit to GitHub.
git push origin mainIf you haven't set up your remote repository yet, add the remote origin:
git remote add origin git@github.com:yourusername/yourrepo.git
git push -u origin mainReplace yourusername and yourrepo with your GitHub username and repository name.
Now, execute the script with the word you want to display on your contribution graph.
./map_word.sh YOURWORDReplace YOURWORD with the word you want to map (e.g., HELLO).
GitHub may take some time (up to 24 hours) to update your contribution graph. Check your GitHub profile to see the visual representation of your word.
-
Git Configuration: Ensure your Git username and email are configured correctly.
git config --global user.name "Your Name" git config --global user.email "youremail@example.com"
The email address should match the one associated with your GitHub account.
-
SSH Authentication: If you're using SSH, make sure your SSH keys are set up correctly.
-
Overwriting History: This script rewrites your repository's history by adding commits in the past. Be cautious if you have an existing repository with important commits.
-
Force Push (if necessary): If you encounter issues pushing due to conflicts, you may need to force push.
git push --force origin main
Warning: Force pushing can overwrite commits on the remote repository. Use with caution.
-
Commits Not Appearing:
- It may take time for contributions to appear on your GitHub graph.
- Ensure that the commits are pushed to GitHub and the commit dates are correct.
- Verify that the email in your Git config matches your GitHub account.
-
Authentication Issues:
- If you're prompted for a username and password, set up SSH keys for authentication.
- Alternatively, use a personal access token if you're using HTTPS.
-
Script Errors:
- Check that all FONT definitions are included.
- Ensure you have execute permissions for the script.
- Verify that you're running the script in the correct directory.
-
Windows Users:
- Use Git Bash or WSL, not Command Prompt or PowerShell.
- Ensure Unix commands like
chmodare recognized.
-
Adjusting Commit Intensity: By default, the script makes 5 commits for each active day. You can change this number by modifying the loop in the script:
for i in {1..5}; do # Your commit commands done
-
Changing the Branch: If you want to push to a different branch, modify the
git pushcommand at the end of the script. -
Modifying the Font: You can customize the font by editing the FONT array in the script.
-
Use Responsibly: Altering commit history and making numerous commits can have implications. Use this script responsibly and in accordance with GitHub's terms of service.
-
GitHub Policies: Ensure your use of this script complies with GitHub's policies on usage and automation.
-
Personal Repository Recommended: It's recommended to use a new, personal repository for this script to avoid impacting important project histories.
This project is licensed under the MIT License.
Enjoy creating custom patterns on your GitHub contribution graph!
If you have any questions or need assistance, feel free to reach out by opening an issue in the repository or contacting me directly.