CLI tool that automates the process of creating commits in a Git repository over a specified date range. The tool gives you control over the frequency, number, and conditions of the commits using configurable flags.
- Generate commits for each day between a given start and end date.
- Specify the minimum and maximum number of commits per day.
- Apply a "salt" effect that gives more weight to the first 25% of the
minCommitvalue. - Option to prevent clearing the
commit.txtfile if it exceeds a threshold (25KB by default). - Control the frequency of commits using the
freqparameter (0-100%). - Automatically initializes a Git repository if it's not already set up.
- Automatically creates necessary files and directories (
commit.txt,./.commits).
start(required): The start date for commit generation (format:YYYY-MM-DD).end(required): The end date for commit generation (format:YYYY-MM-DD).min(optional, default:2): The minimum number of commits to make each day.max(optional, default:25): The maximum number of commits to make each day.salt(optional, default:false): The "salt" value, affecting commit distribution, giving more weight to the first 25% ofminCommit.no-clear(optional, default:false): If set, prevents clearing of thecommit.txtfile when it exceeds the default threshold of 25KB.freq(optional, default:100): A percentage that controls the likelihood of committing on a given day. Iffreqis less than 100, some days may have no commits.
go run main.go --start 2025-10-03 --end 2025-10-15 --freq 85 --min 2 --max 10 --salt --no-clearClone the repository and build the Go project:
git clone https://github.com/<yourusername>/commit-mask.git
cd commit-mask
go run main.go --start 2025-10-03 --end 2025-10-15 --freq 85 --min 2 --max 10 --saltThis will generate commits for each day between start and end.
-
Initialization:
- The tool first checks if the current directory is initialized as a Git repository. If not, it will automatically initialize a new Git repository.
-
File Check:
- The tool checks for the existence of
commit.txtand the./.commitsdirectory. If these are missing, they are created.
- The tool checks for the existence of
-
Commit Generation:
-
For each day between the start and end dates:
- A random number of commits between
minCommitandmaxCommitis chosen. - If
saltis set, the first 25% of commits get 4 times weightage, next 25% for 3 times weightage. - The frequency (
freq) is used to determine the chance of committing on a given day. - Each time commit gets a unique UID - defined by the date and time the command was executed.
- A random number of commits between
-
-
Threshold Check for
commit.txt:- If the
noClearflag is not set and the size ofcommit.txtexceeds 25KB(default), the file will be cleared to avoid any unnecessary bloating.
- If the
- The tool uses
gitto make the commits, so make suregitis installed and accessible in your system's path. - All commits are made with the current date and time as the UID, so you can track when each commit was made.