Generate Git commits with custom timestamps and experiment with GitHub contribution graphs.
README em PortuguΓͺs β π§π· PortuguΓͺs
Commit Farm is a Node.js project for experimenting with Git history, custom commit timestamps, and GitHub contribution graphs.
The script generates commit dates within a configurable period, creates Git commits using those timestamps, and pushes them to the configured remote repository.
It is designed as a practical exercise for understanding how Git commits, timestamps, Node.js modules, and GitHub contribution data work together.
Note: This project is intended for educational and experimental purposes. Generated commits should not be presented as evidence of work that was not actually performed.
- Generate a configurable number of commits.
- Generate random commit dates within a custom date range.
- Set commit timestamps using Git's
--dateoption. - Automatically commit and push changes.
- Store the generated date in
data.json. - Experiment with different contribution graph distributions.
The process is:
Define the date range
(Caution: Do not enter dates that have not yet arrived (enter future dates)).
β
Generate a random number of days
β
Calculate the commit date
β
Save the date to data.json
β
Create the Git commit
β
Push to the remote repository
β
Repeat until all commits are generated
The main logic is contained in src/index.js.
momenthandles date calculations.randomgenerates random values.jsonfilewrites the generated date todata.json.simple-gitexecutes Git operations.
git clone https://github.com/PedrReis-create/commits-farm.git
cd commits-farmInstall all dependencies listed in package.json:
npm install simple-git moment random jsonfileThe project uses:
momentsimple-gitrandomjsonfile
Before running the script, make sure Git is configured:
git config user.name "Your Name"
git config user.email "your-email@example.com"Check your configuration with:
git config --listThe repository must also have a remote configured:
git remote -vOpen:
src/index.js
You can change the number of commits and the date range before running the script.
See DATE-GUIDE.md for detailed instructions on changing dates. (Caution: Do not enter dates that have not yet arrived (enter future dates)).
node src/index.jsThe script will generate commits according to the configuration in src/index.js.
At the bottom of src/index.js:
makeCommits(300);Change 300 to the desired number:
makeCommits(100);This generates 100 commits.
The date range is controlled by:
const startDate = moment("2025-01-01");
const endDate = moment("2025-12-31");For example, to use all of 2024:
const startDate = moment("2024-01-01");
const endDate = moment("2024-12-31");To use 2024 through 2026:
const startDate = moment("2024-01-01");
const endDate = moment("2026-12-31");For custom ranges:
const startDate = moment("2025-06-01");
const endDate = moment("2025-09-30");The date format is:
YYYY-MM-DD
For more examples, see DATE-GUIDE.md.
commit-farm/
β
βββ docs/
β βββ DATE-GUIDE.md
βββ src/
β βββ index.js
βββ .gitignore
βββ LICENSE
βββ package.json
βββ package-lock.json
βββ README.md
βββ README.pt-BR.md
βββ data.json
| File | Description |
|---|---|
src/index.js |
Main script that generates dates and commits |
docs/DATE-GUIDE.md |
Detailed guide for changing date ranges |
data.json |
Stores the timestamp generated for the current commit |
package.json |
Project configuration and dependencies |
package-lock.json |
Locks dependency versions |
README.md |
Project documentation |
LICENSE |
Project license |
.gitignore |
Files and directories excluded from Git |
node_modules/is created automatically by npm and should not be committed to the repository.
| Package | Purpose |
|---|---|
moment |
Date and time manipulation |
simple-git |
Git command interface |
random |
Random number generation |
jsonfile |
JSON file management |
The project can be extended in several ways:
- Commit quantity β Change the total number of generated commits.
- Date range β Define the earliest and latest possible dates.
- Commit distribution β Change how dates are randomly selected.
- Commit density β Control how frequently commits occur across the selected period.
- Patterns β Experiment with different distributions on the contribution graph.
The current implementation selects each date independently, so multiple commits can be generated for the same day.
A commit timestamp does not automatically guarantee that GitHub will count the commit as a contribution.
GitHub applies its own contribution rules, including repository and commit requirements.
Although Git can store timestamps in the future, GitHub does not treat future activity as ordinary historical contributions before the corresponding dates occur.
The author and committer information used by Git must be configured correctly:
git config user.name
git config user.emailIf you are experimenting with contribution graphs, consider using a private repository.
A private repository prevents users without access from viewing its commits and files. GitHub may still display anonymized private contribution activity on your profile depending on your contribution settings.
For detailed instructions on changing the date range:
Huge thanks to fenrir2608 for the original goGreen project and the inspiration behind this implementation.
This project was developed independently as a learning and experimentation exercise.
Made with JavaScript & Git