Skip to content

Example of how to setup a 2nd ssh credential file, to work with a 2nd github account from one machine.

License

Notifications You must be signed in to change notification settings

nigelprimex/workrepo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

workrepo

Example of how to setup a 2nd ssh credential file, to work with a 2nd github account from one machine.

For example if you have one account for your job, and another personal one.

First generate a new ssh key

In your repository settings add 'sshCommmand'

#> git config core.sshCommand "ssh -i ~/.ssh/yournewkeyfile -o IdentitiesOnly=yes"

If you originally cloned the repo via https, change to ssh.

Edit your .git/config [remote "origin"] from

url = https://github.com/nigelprimex/workrepo.git

to:

url = [email protected]:nigelprimex/workrepo.git

Otherwise set up an "origin" remote.

#> git remote add origin [email protected]:nigelprimex/workrepo.git

About

Example of how to setup a 2nd ssh credential file, to work with a 2nd github account from one machine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published