auto-git-command
v1.0.6
Published
Automatically Init if not initialize, pull, stage, commit, remote and push changes to your Git repository on a configurable schedule. Perfect for developers who want hassle-free auto pull, add, commits and push on interval.
Downloads
690
Maintainers
Readme
Auto Git Command
Automatically init (if not initialized), pull, stage, commit, and push changes to your Git repository on a configurable schedule. Perfect for developers who want hassle-free auto pull, add, commits and push on interval.
🚀 Installation
Install globally to use the git-auto command anywhere:
npm install -g auto-git-commandOr locally in your project:
npm install auto-git-command⚡ CLI Commands
Once installed, you can use the following commands:
| Command | Description |
|---------|-------------|
| git-auto start | Start auto-git. Runs immediately and sets interval from state.json or CLI flag. |
| git-auto pause | Pause auto-git temporarily. No commits will be made until resumed. |
| git-auto continue | Resume auto-git after pause. Uses previously saved interval. |
| git-auto list | List current Git status, branch, staged/unstaged changes, and auto-git interval. |
🔧 Command Options
| Option | Shortcut | Description |
|--------|----------|-------------|
| --branch <name> | -b | Specify a branch to commit and push to. Default: current branch |
| --message <msg> | -m | Custom commit message. If not provided, auto-git generates one. |
| --interval <time> | -i | Interval between auto-commits. Format examples: 5min, 2hr, 1dy, 1mth. Default: 2min |
| --remote <url> | -r | Set or update remote repository URL |
⚡ Examples
Start auto-git with default settings:
git-auto startStart auto-git with a custom interval (e.g., 5 minutes):
git-auto start -i 5minPause auto-git:
git-auto pauseResume auto-git:
git-auto continueList Git repo status and auto-git settings:
git-auto listCommit to a specific branch with a custom message:
git-auto start -b develop -m "Auto commit changes"Set remote URL:
git-auto start -r [email protected]:username/repo.git📝 Configuration File
Auto-git stores its state in state.json (created automatically in the project folder):
{
"paused": false,
"interval": "5min"
}- paused — Whether auto-git is paused
- interval — Current interval between commits
📌 Notes
- Requires Node.js >= 18
- Compatible with Windows, macOS, Linux
- Notifies on each commit using
node-notifier(desktop notifications)
⭐ Tips
- Avoid running multiple auto-git instances on the same repo.
- When cancel start command on terminal run (git-auto pause) to pause the commit.
📄 License
MIT
🤝 Contributing
Contributions, issues, and feature requests are welcome!
📧 Support
If you encounter any issues, please open an issue.
