gitwatch
Watch Git repository for changes in real-time
TLDR
Automatically commit any changes made to a file or directory
Automatically commit changes and push them to a remote repository
Automatically commit changes and push them to a specific branch of a remote repository
SYNOPSIS
gitwatch [OPTIONS] [PATH]
PARAMETERS
--repo
Remote Git repository URL to push to
--branch
Target branch name (default: current)
--message
Commit message template (e.g., "Auto: {files}")
--exclude
Glob pattern for files to ignore (repeatable)
--no-push
Commit only, skip push
--daemon
Run as background daemon
--pid-file
Path to PID file for daemon
-v, --verbose
Enable verbose logging
-h, --help
Show usage help
DESCRIPTION
gitwatch is a lightweight command-line utility that monitors a directory for file modifications, additions, or deletions using filesystem events (via inotify on Linux). Upon detecting changes, it automatically stages files, creates a commit with a customizable message, and optionally pushes to a remote repository.
Designed for developers seeking hands-free version control during active coding sessions, backups, or CI-like workflows. It supports excluding files via glob patterns, running as a daemon, and message templates incorporating changed files or timestamps.
Requires a Git repository in the watched path. Not a core Git command; install via package managers, pip, or source (e.g., Rust or Python implementations). Ideal for local dev but use cautiously in shared repos to avoid noise commits.
CAVEATS
Risk of committing unintended changes or sensitive data; requires initialized Git repo; inotify watch limits may apply on large dirs; not suitable for production without safeguards; multiple implementations exist (check source).
INSTALLATION
Rust: cargo install gitwatch
Python: pip install gitwatch
Or build from GitHub repos.
CONFIGURATION
Supports ~/.gitwatchrc for defaults; see gitwatch --help for templates.
HISTORY
Originated as open-source projects around 2014; popular Rust impl. by smola (2018+); Python versions via pip; evolved for dev automation amid rise of CI tools.
SEE ALSO
git(1), inotifywait(1), fswatch(1), watchexec(1)


