Gitの備忘録(2)

今更のssh対応*1

1. ssh-keyの生成

略。

2. Githubに公開キー設定

略。

3. configファイルの設定

$ cat ~/.ssh/config
Host github.com
     User s-hironobu
     Hostname   github.com
     IdentityFile   ~/.ssh/id_rsa
$ chmod 600 ~/.ssh/config

4. 各リポジトリでの設定

git remte -vで確認して、httpsのままだったら。

$ git remote set-url origin git@github.com:s-hironobu/XXX_REPOSITORY_NAME

*1:他人のリポジトリにpushする場合は、やはり2段階認証が必要なんだろうなあ。携帯など他のデバイスに依存するのも嫌なんだけども。