This README currently represents a specification of HubSync's planned functionality. Please wait until the gem is released to use.
Synchronize your GitHub repositories for offline viewing.
HubSync allows you to manage your collection of repositories on GitHub. It will automatically pull or fetch each repository in the target directory for you.
Please note that HubSync is not a synchronization tool in the classic sense, in that it does not push any changes back to GitHub for you. HubSync is meant to allow you to efficiently maintain a clone of your own repositories, repositories you collaborate on, and your watchlist (or even another user's public repositories or watchlist if you so desire).
- git (tested with version 1.7.2.2)
- bundler 1.0.0 (for development)
- ruby 1.9.2 (for development)
$ gem install hubsync
HubSync uses the Git global options github.user
and github.token
when
accessing your own repositories and your watchlist. More information on setting
these options can be found in GitHub's
official help.
Additionally, passing your GitHub username and token via the environment
variables HUBSYNC_GITHUB_USER
and HUBSYNC_GITHUB_TOKEN
, or passing the
--my-user
and my-token
options will override the global Git options (the
command line options will override the environment variables as well).
$ hubsync [options] [directory]
$ hubsync -o [directory]
$ hubsync -c [directory]
$ hubsync -w [directory]
$ hubsync -u <username> [directory]
$ hubsync -wu <username> [directory]
Use hubsync --help
for the full list of options.
--own, -o
: Synchronize repositories that you own.--collabed, -c
: Synchronize repositories that you are a collaborator on.--watched, -w
: Synchronize watched repositories in the target directory for the yourself (by default or if-o
is set) or for the specified user (if-u
is used).--user, -u <username>
: Synchronize repositories in the target directory publicly owned (or watched if-w
is used) by the specified user.
--my-user
: The username to use when-o
or-c
are used. Must be used with--my-token
. This overrides any other configuration set via global Git settings or environment variables.--my-token
: The token to use when-o
or-c
are used. Must be used with--my-user
. This overrides any other configuration set via global Git settings or environment variables.--fetch, -f
: Usegit fetch
instead ofgit pull
when updating.--prepend-username, -r
: Prepend repositorys' usernames to the clone directory names. This is set by default when-c
,-u
, or-w
are used.--no-prepend-username, -R
: Don't prepend repositorys' usernames to the clone directory names.--prepend-sep, -s
: The separator for the prepended username (defaults to-
).
Running hubsync
with no options is equivalent to the following:
$ hubsync -oc .
HubSync can be automatically run via your crontab. An example template is
included in doc/hubsync.crontab
.
Other repositories in the target directory are left alone when running HubSync.
HubSync keeps a list of the repositories it manages in the target directory
(accessible in the .hubsync
file at the root of the directory`), and only
those repositories are updated when running HubSync.
HubSync uses Bundler to manage its dependencies during
development. To begin development, fork dirtyalpaca/hubsync, ensure you
have Bundler (>= 1.0.0) installed and run bundle install
inside the clone of
your fork.
Specs can be run via rake spec
and features via rake cucumber
.
Code coverage for both specs and features is automatically generated on each run via SimpleCov.
The workflow for contributing code to HubSync is as follows:
- Fork dirtyalpaca/hubsync.
- Create a topic branch for your feature or bug fix.
- Include specs (and features if appropriate) for your code (it won't be accepted otherwise).
- Create an issue in HubSync's issue tracker if there isn't one already.
- Link to the topic branch you created in the issue's description or your comments.
- Send me a pull request
Copyright (c) 2010 by Anthony Burns. See the LICENSE for details.