|
1 | | -# 🌱 goGreen |
| 1 | +# 🤖 GitHub Contribution Graph Enhancer (goGreen Fork) |
2 | 2 |
|
3 | | -With **goGreen**, you can make your profile look like you've been hard at work... even if you haven't. |
4 | | -NodeJs script to make commits to the past (or the future) to go green on GitHub. |
| 3 | +[](/LICENSE) [](https://github.com/Dynamo14324/github-bot/actions/workflows/node.js.yml) <!-- Placeholder CI Badge --> |
5 | 4 |
|
6 | | -## About |
| 5 | +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. |
7 | 6 |
|
8 | | -**goGreen** helps you create commits on your GitHub profile for any date in the past. Whether you want to fill up your contribution graph or even make cool patterns and artwork. |
| 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. |
9 | 8 |
|
10 | | -## Getting Started |
| 9 | +## ✨ Features |
11 | 10 |
|
12 | | -Follow these steps to bring your contribution graph to life: |
| 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. |
13 | 15 |
|
14 | | -1. **Clone this repository** |
15 | | -```bash |
16 | | -git clone https://github.com/fenrir2608/goGreen.git |
17 | | -cd goGreen |
18 | | -``` |
19 | | -3. **Set up your project** |
20 | | -Initialize a new Node.js project: |
21 | | -```bash |
22 | | -npm init -y |
23 | | - ``` |
24 | | -3. **Install the required npm modules** |
25 | | -You'll need a few modules to get everything running smoothly. Install them all with: |
26 | | - ```bash |
27 | | - npm install moment simple-git random |
28 | | - ``` |
29 | | -4. **Create your commit script** |
30 | | -- Create a JavaScript file to manage your commits. |
31 | | -- Create a JSON file to store all the commit timestamp data. |
| 16 | +## 🚀 Getting Started |
32 | 17 |
|
33 | | -## Room for Improvement |
| 18 | +Follow these steps to get started: |
34 | 19 |
|
35 | | -So, you've got the basics down. What's next? |
| 20 | +1. **Clone this Repository:** |
| 21 | + ```bash |
| 22 | + git clone https://github.com/Dynamo14324/github-bot.git |
| 23 | + cd github-bot |
| 24 | + ``` |
36 | 25 |
|
37 | | -- **Custom Patterns:** Experiment with different patterns on your contribution graph. Maybe spell out your name or create some cool designs. |
38 | | -- **Density Control:** Play around with the number of commits per day to adjust the shades of green. |
39 | | -- **Input Strings:** Convert input strings to X-Y mapped contributions. |
| 26 | +2. **Install Dependencies:** |
| 27 | + Make sure you have Node.js installed. Then run: |
| 28 | + ```bash |
| 29 | + npm install |
| 30 | + ``` |
| 31 | + This installs the necessary packages (`moment`, `simple-git`, `jsonfile`, `random`). |
40 | 32 |
|
41 | | -## npm Modules Used |
| 33 | +3. **Configure Your Repository:** |
| 34 | + * This script makes commits *within the cloned repository itself* (`github-bot`). |
| 35 | + * Ensure you have set your Git user name and email globally or locally for this repository: |
| 36 | + ```bash |
| 37 | + git config user.name "Your Name" |
| 38 | + git config user.email "[email protected]" |
| 39 | + ``` |
| 40 | + * **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. |
42 | 41 |
|
43 | | -- [`moment`](https://www.npmjs.com/package/moment) - Handles date and time manipulation. |
44 | | -- [`simple-git`](https://www.npmjs.com/package/simple-git) - For easy Git commands. |
45 | | -- [`random`](https://www.npmjs.com/package/random) - To generate random numbers for the commits. |
| 42 | +4. **Run the Script:** |
| 43 | + Execute the script to start making backdated commits: |
| 44 | + ```bash |
| 45 | + node index.js |
| 46 | + ``` |
| 47 | + The script will output the dates for which it is creating commits. |
46 | 48 |
|
47 | | -## Credits |
| 49 | +5. **Push Your Changes:** |
| 50 | + After the script finishes (or periodically), push the changes made to `data.json` back to GitHub: |
| 51 | + ```bash |
| 52 | + git add data.json |
| 53 | + git commit -m "feat: Update contribution data" # Or any commit message |
| 54 | + git push origin main # Or your default branch |
| 55 | + ``` |
| 56 | + Allow some time for GitHub to update your contribution graph. |
| 57 | + |
| 58 | +## ⚙️ How It Works |
| 59 | + |
| 60 | +Here's a simplified view of the script's workflow: |
| 61 | + |
| 62 | + |
| 63 | + |
| 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`). |
| 71 | + |
| 72 | +## 🎨 Customization & Ideas |
| 73 | + |
| 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 in a *different* repository if desired (requires careful path management and Git initialization in the target repo). |
| 78 | + |
| 79 | +## 🤝 Contributing |
| 80 | + |
| 81 | +Contributions, issues, and feature requests are welcome! |
| 82 | + |
| 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 |
| 88 | + |
| 89 | +## 📜 License |
| 90 | + |
| 91 | +Distributed under the MIT License. See `LICENSE` for more information. |
| 92 | + |
| 93 | +## 🙏 Acknowledgements |
| 94 | + |
| 95 | +* Original concept inspired by Akshay Saini's video tutorial. |
| 96 | +* Libraries: `moment`, `simple-git`, `jsonfile`, `random`. |
48 | 97 |
|
49 | | -Huge thanks to [Akshay Saini](https://github.com/akshaymarch7) for the original video behind this project. |
|
0 commit comments