girror
v0.2.11
Published
Efficient mirror of git repositories. Great for continuous deployment
Downloads
33
Readme
girror - Efficient mirrorring of git remotes
girror maintains mirrors of git repositories on the local system using a bare repository cache. This makes it especially useful to handle post-commit triggers and automatically pull changes from a remote.
$ npm install -g girror
$ girror --remote [email protected]/eladb/node-girror --worktree /tmp/node-girror-master
$ girror --remote [email protected]/eladb/node-girror --worktree /tmp/node-girror-branch1 --branch branch1
Command line tool
$ girror --help
Usage: girror [options]
Options:
-h, --help output usage information
-r, --remote <url> git remote url (required)
-w, --worktree <path> path to worktree (required)
-b, --branch <branch> branch to mirror (default: master)
-v, --verbose verbose output
API
girror(remote, worktree, options, callback)
remote
- the URL of the git remoteworktree
- path to local working directory (where you want files to be checked out into)options.branch
- branch to checkout (default ismaster
)options.cachedir
- where to store the bare repo cache that makes girror so awesome (default is $GIRROR_CACHE || ($TMP || $TEMP || /tmp)/girror-cache)options.logger
- optional alternative toconsole
.
Using girror for continuous deployment
girror was built to enable automatic deployment from source control:
- Set up a post-commit HTTP trigger on your favorite source control that will POST into some endpoint on your servers.
- Invoke girror to sync from the remote repository into the local filesystem. girror will do it as efficiently and painlessly as possible (no merges, no cleanups, only clean diffs).
- You can also use it to sync multiple branches into your production servers and use them as staging environments (yeah!).
I will create a "girror-middleware" for express so you can just plug it in and have all this automated.
License
MIT