0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ssh の公開鍵認証を使用したGithub にあるリポジトリの cloneのしかた

Last updated at Posted at 2019-09-26

備忘録です。

ssh の公開鍵認証を使用してgithubからクローンしたい時は以下のようにする。

~/.ssh/config
Host forGithub ← ここ大事
User git
Hostname github.com
Port 22
IdentityFile ~/.ssh/id_rsa_for_git ←各リポジトリ毎に鍵を作成する。
ServerAliveInterval 120

github の各リポジトリで公開鍵を登録する。

$ git clone forGithub:githubのログイン名/リポジトリ名.git

例えば hoge さんの huga リポジトリをとってくる場合。

$ git clone forGithub:hoge/huga.git

とすればオーケー。

#補足
ssh-add をするのをお忘れなく。

0
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?