Skip to content

tdevelioglu/watchgit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watchgit

####Table of Contents

  1. Overview - What it is
  2. Description - What it does
  3. Setup - How to set it up
  4. Usage - How to use it

Overview

Keep local git repositories in sync

Description

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.

Setup

Requirements

Installation

Setuptools

python setup.py install

RPM

(TODO - files can be found under ext/redhat)

Usage

watchgit.py

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

watchgit.conf

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

Global parameters

  • 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.

Repo parameters

  • 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.

About

Keep local git repositories in sync

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages