Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

git-deploy-keys-setup

How to create different deploy keys for seperate repositories

  • generate a ssh key-pair ssh-keygen -f /home/wwwutz/.ssh/blabla_rsa
  • add /home/wwwutz/.ssh/blabla_rsa.pub as a deploy key to repository blabla on github.molgen.mpg.de
  • edit ~/.ssh/config
Host blabla.github.molgen.mpg.de
  HostName github.molgen.mpg.de
  User git
  IdentityFile /home/wwwutz/.ssh/blabla_rsa
  IdentitiesOnly yes
  • when cloning the repo use git clone git@blabla.github.molgen.mpg.de:wwwutz/foobar.git (! hostname !)

idea behind it

  • use an individual ssh key per repository
  • ssh to a different 'host'
  • let ssh use the real host redirected by .ssh/config
  • use the individual key as configured .ssh/config