ghq | Cygwin64 環境に ghq をインストール
概要
Cygwin64 環境に ghq をインストールします。
ghq の導入記事はたくさんあるけど、 Qiita 内を「 ghq cygwin」 で検索したら1件もなかったのでメモを残す。
ghq とは?
motemen さん製の リモートリポジトリ管理ツール。
golang の go get のようにリモートリポジトリを管理する手段を提供する。
go get の詳細については golang の 公式ドキュメント 参照。
手順
- ghq の GitHub releases ページ から必要なバイナリの圧縮ファイルを取得
今回は Windows の 64 bit 版 をチョイス - zip を解凍
-
%cygwin64 root%/bin
に、 ghq.exe をコピー
疎通確認
$ ghq
NAME:
ghq - Manage GitHub repository clones
USAGE:
ghq [global options] command [command options] [arguments...]
VERSION:
v0.5 (master)
AUTHOR:
motemen - <motemen@gmail.com>
COMMANDS:
get Clone/sync with a remote repository
list List local repositories
look Look into a local repository
import Bulk get repositories from stdin
root Show repositories' root
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
# ghq get はデフォルトでホームディレクトリ配下に .ghq ディレクトリを作成し、
# そこにリポジトリを clone します
$ ghq get https://github.com/tbpgr/aun.git
clone https://github.com/tbpgr/aun.git -> path\to\your\user dir\.ghq/github.com/tbpgr/aun
git clone https://github.com/tbpgr/aun.git path\to\your\user dir\.ghq/github.com/tbpgr/aun
Cloning into 'path\to\your\user dir\.ghq/github.com/tbpgr/aun'...
remote: Counting objects: 75, done.
remote: Total 75 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (75/75), done.
$ path\to\your\user dir\.ghq/
$ tree
.
┗ github.com
┗ tbpgr
┗ aun
┣ aun.gemspec
┣ bin
┃ ┗ aun
┣ Gemfile
┣ images
┃ ┗ aun.gif
┣ lib
┃ ┣ aun
┃ ┃ ┣ default_messages.rb
┃ ┃ ┣ definition_manager.rb
┃ ┃ ┣ finder.rb
┃ ┃ ┣ message.rb
┃ ┃ ┣ message_formatter.rb
┃ ┃ ┗ version.rb
┃ ┗ aun_core.rb
┣ LICENSE.txt
┣ Rakefile
┣ README.md
┣ rubocop-todo.yml
┗ spec
┣ aun
┃ ┣ finder_spec.rb
┃ ┣ message_formatter_spec.rb
┃ ┗ message_spec.rb
┗ spec_helper.rb