Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Host github-repo01
HostName github.com
User git
IdentityFile ~/.ssh/github-repo01

Host github-repo02
HostName github.com
User git
IdentityFile ~/.ssh/github-repo02

Host giftprocessing.github.com
HostName github.com
User git
IdentityFile ~/.ssh/github_giftprocessing

Next is add the public key into the GitHub repository, please link to the repository and click Setting tab in the upper right..


Back to the server, if the git repo already exist, we need to update the remote url.

Check current url by:

git remote -v

Set the url to new one:

git remote set-url origin  git@giftprocessing.github.com:aad-wsux/giving-day-gift-processing-app.git 


Now back to the server, we can use SSH key to access the GitHub, in this case we want to clone repo01 then command will like below.

git clone github-repo01:{UserName}/repo01.git 

https://medium.com/@shawnoy/multiple-github-deploy-keys-in-a-single-server-34831d13a919 


Your .ssh/config file points to github.com and it doesn't know which key to use when it's time to do the pull.

...

https://gist.github.com/gubatron/d96594d982c5043be6d4