Skip to content

Latest commit

Β 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌱 Commit Farm, yes, commits in days you didn't work

Generate Git commits with custom timestamps and experiment with GitHub contribution graphs.

Node.js JavaScript Git

README em PortuguΓͺs β†’ πŸ‡§πŸ‡· PortuguΓͺs


πŸ“Œ About

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.


✨ Features

  • Generate a configurable number of commits.
  • Generate random commit dates within a custom date range.
  • Set commit timestamps using Git's --date option.
  • Automatically commit and push changes.
  • Store the generated date in data.json.
  • Experiment with different contribution graph distributions.

🧠 How It Works

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.

  • moment handles date calculations.
  • random generates random values.
  • jsonfile writes the generated date to data.json.
  • simple-git executes Git operations.

πŸš€ Getting Started

1. Clone the repository

git clone https://github.com/PedrReis-create/commits-farm.git
cd commits-farm

2. Install dependencies

Install all dependencies listed in package.json:

npm install simple-git moment random jsonfile

The project uses:

  • moment
  • simple-git
  • random
  • jsonfile

3. Configure Git

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 --list

The repository must also have a remote configured:

git remote -v

4. Configure the script

Open:

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)).

5. Run the script

node src/index.js

The script will generate commits according to the configuration in src/index.js.


βš™οΈ Configuration

Number of commits

At the bottom of src/index.js:

makeCommits(300);

Change 300 to the desired number:

makeCommits(100);

This generates 100 commits.


Date range

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.


πŸ“ Project Structure

commit-farm/
β”‚
β”œβ”€β”€ docs/
β”‚   └── DATE-GUIDE.md
β”œβ”€β”€ src/
β”‚   └── index.js
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ package.json
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ README.md
β”œβ”€β”€ README.pt-BR.md
└── data.json

Files

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.


πŸ“¦ Dependencies

Package Purpose
moment Date and time manipulation
simple-git Git command interface
random Random number generation
jsonfile JSON file management

πŸ› οΈ Customization

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.


⚠️ Important Notes

GitHub contribution graph

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.

Future dates

Although Git can store timestamps in the future, GitHub does not treat future activity as ordinary historical contributions before the corresponding dates occur.

Git identity

The author and committer information used by Git must be configured correctly:

git config user.name
git config user.email

πŸ” Privacy

If 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.


πŸ“š Documentation

For detailed instructions on changing the date range:

πŸ“… Read the Date Guide


πŸ™ Credits

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