You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Contributing to GitHub Contribution Graph Enhancer
2
+
3
+
Thank you for considering contributing to this project! We welcome contributions from the community.
4
+
5
+
## How to Contribute
6
+
7
+
1.**Fork the Repository:** Click the 'Fork' button at the top right of the repository page.
8
+
2.**Clone Your Fork:**`git clone https://github.com/YOUR_USERNAME/github-bot.git`
9
+
3.**Create a Branch:**`git checkout -b feature/your-feature-name` or `bugfix/issue-description`
10
+
4.**Make Your Changes:** Implement your feature or fix the bug.
11
+
5.**Test Your Changes:** Ensure your changes work as expected and do not introduce new issues.
12
+
6.**Commit Your Changes:** Write clear and concise commit messages. `git commit -m "feat: Add feature X"` or `fix: Resolve issue Y`
13
+
7.**Push to Your Fork:**`git push origin feature/your-feature-name`
14
+
8.**Open a Pull Request:** Go to the original repository and open a pull request from your fork's branch to the `main` branch of the original repository.
15
+
16
+
## Reporting Issues
17
+
18
+
If you find a bug or have a suggestion, please open an issue on the GitHub repository. Provide as much detail as possible, including:
19
+
20
+
* Steps to reproduce the issue.
21
+
* Expected behavior.
22
+
* Actual behavior.
23
+
* Screenshots (if applicable).
24
+
* Your environment details (OS, Node.js version).
25
+
26
+
## Code Style
27
+
28
+
Please try to follow the existing code style. If you add new dependencies, update the `package.json` file accordingly.
Ever wished your GitHub contribution graph looked a bit more... active? Or maybe you want to create some pixel art on your profile? This script, originally inspired by **goGreen**, lets you make commits dated in the past (or future!), effectively painting your contribution graph green.
9
+
Ever wished your GitHub contribution graph looked a bit more... active? Or perhaps you want to create some pixel art on your profile? This Node.js script, originally inspired by **goGreen**, allows you to programmatically create commits dated in the past (or future!), effectively painting your contribution graph green.
6
10
7
-
**Disclaimer:** This tool is intended for creative expression and personal use (e.g., filling in legitimate gaps from offline work, creating profile art). Using it to misrepresent your activity level is discouraged.
11
+
**Important Disclaimer:** This tool is primarily intended for creative expression and personal use cases, such as:
12
+
* Filling in legitimate contribution gaps from offline work or private repositories.
13
+
* Creating pixel art or patterns on your GitHub profile graph.
14
+
* Learning about Git internals and scripting.
15
+
16
+
Using this tool solely to misrepresent your activity level or inflate contribution metrics is strongly discouraged and goes against the spirit of open source collaboration.
8
17
9
18
## ✨ Features
10
19
11
-
***Backdate Commits:** Create commits for any date to fill your GitHub contribution graph.
12
-
***Simple Setup:** Easy to configure and run with Node.js.
13
-
***Customizable:** Modify the script to control commit frequency and patterns.
14
-
***Creative Potential:** Design patterns or artwork on your contribution graph.
20
+
***Backdate Commits:** Create commits for any past date to fill your GitHub contribution graph.
21
+
***Simple Setup:** Easy to configure and run using Node.js and npm.
22
+
***Customizable:** Modify the script to control commit frequency, date ranges, and patterns.
23
+
***Creative Potential:** Design unique patterns or artwork on your contribution graph.
24
+
***Repository Specific:** Commits are made within the cloned repository, targeting `data.json`.
15
25
16
26
## 🚀 Getting Started
17
27
18
-
Follow these steps to get started:
28
+
Follow these steps to get the script running:
19
29
20
30
1.**Clone this Repository:**
21
31
```bash
@@ -24,74 +34,68 @@ Follow these steps to get started:
24
34
```
25
35
26
36
2. **Install Dependencies:**
27
-
Make sure you have Node.js installed. Then run:
37
+
Ensure you have Node.js (v14 or later recommended) and npm installed. Then run:
28
38
```bash
29
39
npm install
30
40
```
31
-
This installs the necessary packages (`moment`, `simple-git`, `jsonfile`, `random`).
41
+
This installs the necessary packages: `moment`, `simple-git`, `jsonfile`, and `random`.
32
42
33
-
3. **Configure Your Repository:**
34
-
*This script makes commits *within the cloned repository itself* (`github-bot`).
35
-
*Ensure you have setyour Git user name and email globally or locally for this repository:
43
+
3. **Configure Git:**
44
+
*The script makes commits *within this cloned repository* (`github-bot`).
45
+
*Set your Git user name and email locally for this repository (or ensure they are set globally):
***Important:** The script modifies the `data.json` file with each commit. You need to push these changes to *this* repository (`Dynamo14324/github-bot`) for the contributions to appear on your profile graph associated with this repo.
50
+
***Crucial Step:** The script modifies the `data.json` file with each generated commit. You **must**push these changes back to *this* repository (`Dynamo14324/github-bot` or your fork) for the contributions to appear on your profile graph associated with this specific repo.
41
51
42
52
4. **Run the Script:**
43
-
Execute the script to start making backdated commits:
53
+
Execute the script to start generating backdated commits:
44
54
```bash
45
55
node index.js
46
56
```
47
-
The script will output the dates for which it is creating commits.
57
+
The console will output the dates for which commits are being created.
48
58
49
59
5. **Push Your Changes:**
50
-
After the script finishes (or periodically), push the changes made to`data.json` back to GitHub:
60
+
After the script finishes (or periodicallyif running fora long time), push the accumulated changesin`data.json` back to GitHub:
51
61
```bash
52
62
git add data.json
53
-
git commit -m "feat: Update contribution data"#Or any commit message
Allow some timefor GitHub to update your contribution graph.
66
+
Allow some time(usually minutes) for GitHub to process the commits and update your contribution graph.
57
67
58
68
## ⚙️ How It Works
59
69
60
-
Here's a simplified view of the script's workflow:
70
+
The core logic resides in`index.js`. Here’s a breakdown:
61
71
62
72

63
73
64
-
The `index.js` script uses:
65
-
*`moment` to handle date calculations.
66
-
*`jsonfile` to read/write commit timestamps to `data.json`.
67
-
*`simple-git` to execute Git commands programmatically (commit).
68
-
*`random` to generate random dates within a specified range (typically the past year).
69
-
70
-
For each generated date, it modifies the `data.json` file and creates a commit with that specific date using Git environment variables (`GIT_COMMITTER_DATE` and `GIT_AUTHOR_DATE`).
2. **Date Generation:** Uses `random.choice` and `moment` to pick random dates within the last year (or as configured).
76
+
3. **File Modification:** Reads `data.json`, updates a timestamp or counter within it, and writes the file back.
77
+
4. **Git Commit:** Uses `simple-git` to stage `data.json` and create a commit. Crucially, it sets the `GIT_COMMITTER_DATE` and `GIT_AUTHOR_DATE` environment variables for the commit command, effectively backdating it.
78
+
5. **Looping:** Repeats the process for a defined number of iterations (e.g., `ITERATION` constant).
71
79
72
80
## 🎨 Customization & Ideas
73
81
74
-
***Commit Frequency:** Modify the loop in`index.js` (e.g., the `ITERATION` constant) to control how many commits are generated.
75
-
***Date Range:** Adjust the `DATE` calculation using `moment` to target specific periods.
76
-
***Pattern Generation:**Instead of random dates, implement logic to generate dates corresponding to specific patterns or images on the contribution graph.
77
-
***Target Different Repos:** Adapt the script to make commits ina *different* repositoryif desired (requires careful path management and Git initialization in the target repo).
82
+
***Commit Frequency:** Modify the loop or `ITERATION` constant in`index.js`to control the number of commits.
83
+
***Date Range:** Adjust the `DATE` calculation logic using `moment` to target specific historical periods or even future dates.
84
+
***Pattern Generation:**Replace the random date generation with logic to create specific shapes or text on your contribution graph. This requires mapping desired pixels to specific dates.
85
+
***Target Different Repos:** Adapt the script to operate on a *different*localrepository. This would involve changing the working directory for`simple-git`and ensuring that repository is properly initialized and configured.
78
86
79
87
## 🤝 Contributing
80
88
81
-
Contributions, issues, and feature requests are welcome!
89
+
Contributions are highly welcome! Whether it's fixing bugs, improving documentation, or adding new features, your help is appreciated.
82
90
83
-
1. Fork the Project
84
-
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
85
-
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
86
-
4. Push to the Branch (`git push origin feature/AmazingFeature`)
87
-
5. Open a Pull Request
91
+
Please read our [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute.
88
92
89
93
## 📜 License
90
94
91
95
Distributed under the MIT License. See `LICENSE` for more information.
92
96
93
97
## 🙏 Acknowledgements
94
98
95
-
* Original concept inspired by Akshay Saini's video tutorial.
0 commit comments