github.com/halhenke/ghq@v0.8.1-0.20180207100234-7e68f823b46d/ghq.txt (about) 1 = ghq(1) image:https://travis-ci.org/motemen/ghq.svg?branch=master["Build Status", link="https://travis-ci.org/motemen/ghq"] 2 3 == NAME 4 5 ghq - Manage remote repository clones 6 7 == DESCRIPTION 8 9 '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. 10 11 $ ghq get https://github.com/motemen/ghq 12 # Runs `git clone https://github.com/motemen/ghq ~/.ghq/github.com/motemen/ghq` 13 14 You can also list local repositories (+ghq list+), jump into local repositories (+ghq look+), and bulk get repositories by list of URLs (+ghq import+). 15 16 == SYNOPSIS 17 18 [verse] 19 'ghq' get [-u] [-p] (<repository URL> | <user>/<project> | <project>) 20 'ghq' list [-p] [-e] [<query>] 21 'ghq' look (<project> | <path/to/project>) 22 'ghq' import [-u] [-p] < FILE 23 'ghq' import <subcommand> [<args>...] 24 'ghq' root [--all] 25 26 == COMMANDS 27 28 get:: 29 Clone a remote repository under ghq root directory (see 30 <<directory-structures,DIRECTORY STRUCTURES>> below). If the repository is 31 already cloned to local, nothing will happen unless '-u' ('--update') 32 flag is supplied, in which case the local repository is updated ('git pull --ff-only' eg.). 33 When you use '-p' option, the repository is cloned via SSH protocol. + 34 If there are multiple +ghq.root+ s, existing local clones are searched 35 first. Then a new repository clone is created under the primary root if 36 none is found. + 37 With '-shallow' option, a "shallow clone" will be performed (for Git 38 repositories only, 'git clone --depth 1 ...' eg.). Be careful that a 39 shallow-cloned repository cannot be pushed to remote. + 40 Currently Git and Mercurial repositories are supported. 41 42 list:: 43 List locally cloned repositories. If a query argument is given, only 44 repositories whose names contain that query text are listed. '-e' 45 ('--exact') forces the match to be an exact one (i.e. the query equals to 46 _project_ or _user_/_project_) If '-p' ('--full-path') is given, the full paths 47 to the repository root are printed instead of relative ones. 48 49 look:: 50 Look into a locally cloned repository with the shell. 51 52 import:: 53 If no extra arguments given, reads repository URLs from stdin line by line 54 and performs 'get' for each of them. + 55 If given a subcommand name e.g. 'ghq import <subcommand> [<args>...]', 56 ghq looks up a configuration 'ghq.import.<subcommand>' for a command, invokes 57 it, and uses its output as URLs list. See below for 'ghq.import.<subcommand>' 58 in CONFIGURATION section. 59 60 root:: 61 Prints repositories' root (i.e. `ghq.root`). Without '--all' option, the 62 primary one is shown. 63 64 == CONFIGURATION 65 66 Configuration uses 'git-config' variables. 67 68 ghq.root:: 69 The path to directory under which cloned repositories are placed. See 70 <<directory-structures,DIRECTORY STRUCTURES>> below. Defaults to +~/.ghq+. + 71 This variable can have multiple values. If so, the first one becomes 72 primary one i.e. new repository clones are always created under it. You may 73 want to specify "$GOPATH/src" as a secondary root (environment variables 74 should be expanded.) 75 76 ghq.<url>.vcs:: 77 ghq tries to detect the remote repository's VCS backend for non-"github.com" 78 repositories. With this option you can explicitly specify the VCS for the 79 remote repository. The URL is matched against '<url>' using 'git config --get-urlmatch'. + 80 Accepted values are "git", "github" (an alias for "git"), "subversion", 81 "svn" (an alias for "subversion"), "git-svn", "mercurial", "hg" (an alias for "mercurial"), 82 and "darcs". + 83 To get this configuration variable effective, you will need Git 1.8.5 or higher. + 84 For example in .gitconfig: 85 86 .... 87 [ghq "https://git.example.com/repos/"] 88 vcs = git 89 .... 90 91 92 ghq.import.<subcommand>:: 93 When 'import' is called with extra arguments e.g. 'ghq import <subcommand> [<args>...]', 94 first of them is treated as a subcommand name and this configuration value 95 will be used for a command. The command is invoked with rest arguments 96 and expected to print remote repository URLs line by line. + 97 For example with https://github.com/motemen/github-list-starred[github-list-starred]: 98 99 .... 100 # Invoke as `ghq import starred motemen` 101 [ghq "import"] 102 starred = github-list-starred 103 .... 104 105 106 ghq.ghe.host:: 107 The hostname of your GitHub Enterprise installation. A repository that has a 108 hostname set with this key will be regarded as same one as one on GitHub. 109 This variable can have multiple values. If so, `ghq` tries matching with 110 each hostnames. + 111 This option is DEPRECATED, so use "ghq.<url>.vcs" configuration instead. 112 113 == ENVIRONMENT VARIABLES 114 115 GHQ_ROOT:: 116 If set to a path, this value is used as the only root directory regardless 117 of other existing ghq.root settings. 118 119 == [[directory-structures]]DIRECTORY STRUCTURES 120 121 Local repositories are placed under 'ghq.root' with named github.com/_user_/_repo_. 122 123 .... 124 ~/.ghq 125 |-- code.google.com/ 126 | `-- p/ 127 | `-- vim/ 128 `-- github.com/ 129 |-- google/ 130 | `-- go-github/ 131 |-- motemen/ 132 | `-- ghq/ 133 `-- urfave/ 134 `-- cli/ 135 .... 136 137 138 == [[installing]]INSTALLATION 139 140 ---- 141 go get github.com/motemen/ghq 142 ---- 143 144 Or clone the https://github.com/motemen/ghq[repository] and run: 145 146 ---- 147 make install 148 ---- 149 150 == AUTHOR 151 152 motemen <motemen@gmail.com>