This repository contains a Node.js script that automates the process of making random commits to a specified file in a Git repository. The script uses simple-git
for Git operations and moment
for date manipulation.
- Randomly generates commit dates within the past year.
- Writes the generated date to a specified file.
- Commits the changes with the generated date.
- Repeats the process for a user-specified number of commits.
- Prompts for the number of commits to make at runtime.
- Asks if the user wants to start another task after completion, allowing for a new run without restarting the script manually.
- Handles invalid input by asking the user to enter a valid number of commits.
- Uses clear and informative progress bars and messages during the commit process.
- Clone the repository:
git clone https://github.com/reblox01/automated-git-committer.git cd automated-git-committer
- Install the dependencies:
npm install
- If not already initialized, initialize a local Git repository and link it to your remote repository:
# Delete old .git if already exist and create another one git init # Link your repository with your local prj git remote add origin https://github.com/your-username/automated-git-committer.git
-
Open the
index.js
file and adjust theFILE_PATH
constant if necessary. -
Run the script with Node.js:
node index.js
Or
npm start
- The number of commits to make can be adjusted by changing the argument passed to the
makeCommit
function at the bottom of theindex.js
file. For example,makeCommit(10)
will make 10 commits.
- simple-git - A simple interface for running Git commands in any Node.js application.
- moment - A library for parsing, validating, manipulating, and formatting dates.
fs
- File system module for reading and writing files.
If you find this project helpful and would like to support its development, you can buy me a coffee:
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
For any inquiries or support, please contact sohailkoutari@gmail.com.
Thank you to everyone who has supported and contributed to this project. Your feedback and assistance are invaluable.