A neat little tool to make cloning of git repos a little more tidy.
Go to file
2014-06-13 23:41:39 +09:00
pocket gofmt 2014-06-09 13:59:44 +09:00
utils Separate logger as go-colorine 2014-05-31 17:50:58 +09:00
zsh Improved zsh completion 2014-06-07 13:09:10 +09:00
.gitignore initial version 2014-04-29 21:33:29 +09:00
.travis.yml make test 2014-05-16 19:17:46 +09:00
CHANGELOG.md Added changelog for v0.2 2014-06-10 18:56:07 +09:00
commands.go Allow non-GitHub host when -p specified 2014-06-13 20:15:45 +09:00
commands_test.go gofmt 2014-06-09 13:59:44 +09:00
ghq.txt use master branch for wercer status 2014-06-09 23:53:18 +09:00
git.go Fix never use default local repository root issue 2014-06-04 12:33:53 +09:00
git_test.go gofmt 2014-06-09 13:59:44 +09:00
helpers_test.go test ghq get 2014-06-06 19:50:38 +09:00
LICENSE MIT license 2014-06-10 16:31:57 +09:00
local_repository.go search for .git and .hg dirs 2014-06-07 01:07:00 +09:00
local_repository_test.go search for .git and .hg dirs 2014-06-07 01:07:00 +09:00
main.go test ghq get 2014-06-06 19:50:38 +09:00
Makefile include branch in version 2014-06-07 01:09:49 +09:00
README.asciidoc doc 2014-05-01 20:19:29 +09:00
remote_repository.go Support remote repository installation except Github or GHE, Google code. 2014-06-06 19:14:16 +09:00
remote_repository_test.go Merge pull request #8 from tcnksm/support-other-repository 2014-06-07 00:20:10 +09:00
url.go Allow non-GitHub host when -p specified 2014-06-13 20:15:45 +09:00
url_test.go Allow non-GitHub host when -p specified 2014-06-13 20:15:45 +09:00
vcs.go golint 2014-05-31 17:42:42 +09:00
wercker.yml build with goxc 2014-06-12 23:58:15 +09:00

= ghq(1) image:https://app.wercker.com/status/529f9ef4a8e48e2634661d7f2da9523f/s/master["wercker status", link="https://app.wercker.com/project/bykey/529f9ef4a8e48e2634661d7f2da9523f"]

== NAME

ghq - Manage remote repository clones

== DESCRIPTION

'ghq' provides a way to organize remote repository clones, like +go get+ does. When you clone a remote repository by +ghq get+, ghq makes a directory under a specific root directory (by default +~/.ghq+) using the remote repository URL's host and path.

    $ ghq get https://github.com/motemen/ghq
    # Runs `git clone https://github.com/motemen/ghq ~/.ghq/github.com/motemen/ghq`

You can also list local repositories (+ghq list+), jump into local repositories (+ghq look+), and bulk cloning repositories from several web services (+ghq import+).

== SYNOPSIS

[verse]
'ghq' get [-u] <repository URL> | [-u] [-p] <user>/<project>
'ghq' list [-p] [-e] [<query>]
'ghq' look <project> | <user>/<project> | <host>/<user>/<project>
'ghq' import starred [-u] <user>
'ghq' import pocket [-u]

== COMMANDS

get::
    Clone a GitHub repository under ghq root directory. See
    <<directory-structures,DIRECTORY STRUCTURES>> below. If the repository is
    already cloned to local, nothing will happen unless '-u' ('--update')
    flag is supplied, in which case 'git remote update' is executed. +
    When you use '-p' option, the repository is cloned via SSH. +
    If there are multiple +ghq.root+ 's, existing local clones are searched
    first. Then a new repository clone is created under the primary root if
    none is found. +
    Currently supports GitHub and Google Code Project (Git/Mercurial) repositories.

list::
    List locally cloned repositories. If a query argument is given, only
    repositories whose names contain that query text are listed. '-e'
    ('--exact') forces the match to be an exact one (i.e. the query equals to
    _project_ or _user_/_project_) If '-p' ('--full-path') is given, the full paths
    to the repository root are printed instead of relative ones.

look::
    Look into a locally cloned repository with the shell.

import starred::
    Retrieves GitHub repositories that are starred by the user specified and
    performs 'get' for each of them.

import pocket::
    Retrieves http://getpocket.com/[Pocket] entries of github.com and
    performs 'get' for each of them. +
    To use this, needs to be compiled with Pocket consumer key. See <<installing,INSTALLING>>.

== CONFIGURATION

Configuration uses 'git-config' variables.

ghq.root::
    The path to directory under which cloned repositories are placed. See
    <<directory-structures,DIRECTORY STRUCTURES>> below. Defaults to +~/.ghq+. +
    This variable can have multiple values. If so, the first one becomes
    primary one i.e. new repository clones are always created under it. You may
    want to specify "$GOPATH/src" as a secondary root (environment variables
    should be expanded.)

ghq.ghe.host::
    The hostname of your GitHub Enterprise installation. A repository that has a
    hostname set with this key will be regarded as same one as one on GitHub.
    This variable can have multiple values. If so, `ghq` tries matching with
    each hostnames.

== [[directory-structures]]DIRECTORY STRUCTURES

Local repositories are placed under 'ghq.root' with named github.com/_user_/_repo_.

....
~/.ghq
|-- code.google.com/
|   `-- p/
|       `-- vim/
`-- github.com/
    |-- codegangsta/
    |   `-- cli/
    |-- google/
    |   `-- go-github/
    `-- motemen/
        `-- ghq/
....


== [[installing]]INSTALLING

----
go get github.com/motemen/ghq
----

Or clone the https://github.com/motemen/ghq[repository] and run:

----
make install
----

If you want to enable http://getpocket.com/[Pocket] importing feature:

----
go get -ldflags "-X github.com/motemen/ghq/pocket.ConsumerKey <your Pocket consumer key>" github.com/motemen/ghq
----

Or using Makefile:

----
make install POCKET_CONSUMER_KEY=<your Pocket consumer key>
----

== AUTHOR

motemen <motemen@gmail.com>