流石に中には公開したくないものもあるので、private repositoryが欲しくなったりする。
プライベートなリポジトリ - らんだむな記憶で書いたようにBitbucketを使うことにした。
[Gehirn RS2] SSHキーをBitbucketに登録してgitコマンドを使えるようにする - Qiitaを参考にSSHの鍵も登録。
$ cat ~/.ssh/config ForwardAgent yes Host github HostName github.com IdentityFile ~/.ssh/id_rsa.github User xxx Host bitbucket HostName bitbucket.org IdentityFile ~/.ssh/id_rsa.bitbucket User yyy
こんな感じで書いておけばgithubやbitbucketを意識せずに使えるみたい。
$ ssh -T git@github.com Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
$ ssh -T git@bitbucket.org logged in as yyy. You can use git or hg to connect to Bitbucket. Shell access is disabled.
問題なさそう。