Tags

Assume that we’ve already created a git repo

## Need to update the ssh config, see below:
$ vi ~/.ssh/config

# github account
Host *github.com   
  User git
  IdentityFile ~/.ssh/id_rsa_sudogem-github

# another github account
Host *github-slashd0t
  Hostname github.com
  User git
  IdentityFile ~/.ssh/id_rsa_slashd0t

Take note on the HOST ALIAS “github-slashd0t”.
## From your root directory of the project, we’ll add the origin of the repo

$ git remote add origin git@github-slashd0t:slashd0t/docker-mysql57.git

If there’s an existing remote origin, we’ll going to remove it and once its done..add it again.

$ git remote rm origin

## Set local git user & email for that repo

$ git config user.name "slash d0t" && git config user.email d3v0ps00001@gmail.com

## Test the ssh connection if it is using the correct git user.

$ ssh -vT git@github-slashd0t
....
....
Hi slashd0t! You've successfully authenticated, but GitHub does not provide shell access.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
....
....

https://code.tutsplus.com/tutorials/quick-tip-how-to-work-with-github-and-multiple-accounts–net-22574

Advertisements