Это старая версия документа!


Проверяем наличие настроек удаленого доступа

$ git remote -v
origin  git@github.com:username/foo.git (fetch)
origin  git@github.com:username/foo.git (push)
$ git remote rm origin

Устанавливаем настройки на репозитоий username/foo.git github.

$ git remote add origin git@foo.github.com:username/foo.git
$ git remote -v
origin  git@foo.github.com:username/foo.git (fetch)
origin  git@foo.github.com:username/foo.git (push)

Генерируем для репозитория на github username/foo ключ id_rsa-foo.

$ ssh-keygen -t rsa -f ~/.ssh/id_rsa-foo -C https://github.com/username/foo

nano ~/.ssh/config

Host foo.github.com
Hostname github.com
IdentityFile ~/.ssh/id_rsa-foo