鍵の作り方毎回忘れるので覚えているうちに書き残します。
鍵生成
コマンドは、以下の感じで使えばいいと思います。
ssh-keygen -o -t rsa -C"[name]@mail.com" -f"[name]_rsa"
.ssh/config
に登録
Host sample-gitlab
User git
HostName gitlab.com
identityFile ~/.ssh/[name]_rsa
登録されたものがちゃんと動くかテスト
ssh -T [host name]
Gitサービスに登録
pubキーをクリップボードにコピー
pbcopy < ~/.ssh/[name]_rsa.pub
clip < ~/.ssh/[name]_rsa.pub
remote add
~/.ssh/config
で書いたHost名をgit@の後に入れてremoteを登録する
git remote add origin git@[host name]:[user name]/[repository name].git
ひとこと
Happy Hacking!