- Generate as SSH-key
ssh-keygen -t rsa -C "john@doe.com"
, folow the prompts and decide a name, e.g.id_rsa_doe_company
. - Copy the SSH public-key to GitHub from
~/.ssh/id_rsa_doe_company.pub
and tell ssh about the key:ssh-add ~/.ssh/id_rsa_doe_company.pub
- Create a fongi file in
~/.ssh
with the follownig contents:
HOST github-doe-company
HostName github.com
User git
IdentityFIle ~/.ssh/ir_rsa_doe_company
- Add yout remote
git remote add origin git@github-doe-company:username/repo.git
orgit remote set-url origin git@git-doe-company:username/repo.git