LoginSignup
42
33

More than 5 years have passed since last update.

Githubでレポジトリをクローンする時はsshではなくhttp推奨

Posted at

http通信の方がssh通信より高速なため、git cloneする際はhttpでクローンする。

$ git clone https://github.com/user/repo.git

http通信になっているか確認する。

$ git remote -v
origin https://github.com/user/repo.git (fetch)
origin https://github.com/user/repo.git (push)

ただし、httpでクローンすると、pushする際に毎回ユーザ名とパスワードを聞かれるため面倒。http通信からssh通信に変更する。

$ git remote set-url origin git@github.com:user/repo.git

ssh通信に変更されているか確認する。

$ git remote -v
origin git@github.com:user/repo.git (fetch)
origin git@github.com:user/repo.git (push)

これでssh通信に変更される。

参考URL

http://tech.nitoyon.com/ja/blog/2013/01/11/github-clone-http/
http://qiita.com/keisuke2236/items/df7d4c2cf621eeddd468

42
33
1

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
42
33