####Table of Contents
Keep local git repositories in sync
Watchgit is a daemon that keeps local git repositories in sync. It does this by periodically pulling a remote for every repository specified in its configuration file.
- Monitors repositories specified in watchgit.conf
- Periodically pulls a ref specified by ref and interval from a remote
- Clones the repository if it does not exist.
- Python 2.7
- python-daemon (>=1.6)
- GitPython (>= 0.3.1)
python setup.py install
(TODO - files can be found under ext/redhat)
usage: watchgit.py [-h] [-c CONFIG] [-p PIDFILE] [-f] command
positional arguments:
command [start|stop|status]
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
configuration file. (Default: watchgit.conf)
-p PIDFILE, --pidfile PIDFILE
pid file. (Default: watchgit.pid)
-f, --foreground run in foreground
Global defaults and parameters such as logfile and loglevel are specified under the GLOBAL
section.
[GLOBAL]
all_remotes = false
interval = 5
ref = master
reset = true
logfile = watchgit.log
loglevel = info
skip_on_error = false
user = nobody
group = nogroup
Individual repositories are specified as their own section with the name of the repository as the section name.
[watchgit]
all_remotes = true
interval = 300
local = /opt/watchgit/
remote = https://github.com/tdevelioglu/watchgit.git
reset = false
skip_on_error = true
user = someuser
group = somegroup
all_remotes
- Whether to pull all git remotes in a repository's git configuration.interval
- How frequently to pull a repository's remote.ref
- Remote ref to use when pulling.reset
- Whether to reset the local HEAD before pulling.logfile
- Location of the logfile.loglevel
- Log level.skip_on_error
- Whether to skip repositories if an error occurs during clone or open.user
- User to run the watchgit daemon as.group
- Group to run the watchgit daemon as.
all_remotes
- Whether to pull all git remotes in the repository's git configuration.interval
- How frequently to pull the repository's remote.local
- Local filesystem path to the repository.remote
- Url to the remote repository.ref
- Remote ref to use when pulling.reset
- Whether to reset the local HEAD before pulling.skip_on_error
- Whether to skip the repository if an error occurs during clone or open.user
- User to watch the repository as.group
- Group to watch the repository as.