秘密鍵を指定してGitHubからgit cloneする

前提

GitHubのリポジトリのURL

 git@github.com:mycompany/myrepo.git

手順

.ssh/configの編集

 Host mycompany-github
    HostName github.com
    User git
    IdentityFile ~/.ssh/mycompany.key
    IdentitiesOnly yes
  • ここではHost名をmycompany-github、秘密鍵をmycomapny.keyとした

git cloneの実行

 git clone git@mycompany-github:mycompany/myrepo.git

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS

Last-modified: 2020-09-17 (木) 09:11:50