LoginSignup
2
1

More than 5 years have passed since last update.

ghq getを踏み台経由で行うときのコマンド

Last updated at Posted at 2019-01-29

ローカルのgitlabなど踏み台サーバ経由でアクセスするようなクローズドなgit環境からghq getしたいときの書き方です

https://<ホスト名>/gitlab/<親の名前>/<リポジトリ名>/tree/master
にアクセスしたいとき、
下記のコマンドをたたく

ghq get git@<ホスト名>:<親の名前>/<リポジトリ名>.git

事前に~/.ssh/configに下記のように書いておく

~/.ssh/config
Host <ホスト名>
    HostName        <ホスト名>
    Port            22
    IdentityFile    ~/.ssh/id_rsa
    User            git
    ProxyCommand    ssh -qCW %h:%p <踏み台接続名>

Host <踏み台接続名>
    HostName        <踏み台サーバのIPアドレス>
    Port            22
    IdentityFile    ~/.ssh/id_rsa
    User            <あなたのユーザ名>

参考
http://jetglass.hatenablog.jp/entry/2015/04/23/184339

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1