You can view the created files (one without extension and one with
~/.ssh/. When creating several of them, you may want to rename them appropriately (e.g. work, pers...).
to the relevant github account: https://github.com/settings/ssh/new
The configuration file for ssh is usually not created by default so we create it:
Now paste in the config file the following:
# work account Host work.github.com HostName github.com User git IdentityFile ~/.ssh/work # personnal account Host pers.github.com HostName github.com User git IdentityFile ~/.ssh/pers
Usually, the ssh clone url looks like this:
To link the right ssh key, prepend to
work depending on who should be committing.
This results in the following git clone command:
git clone firstname.lastname@example.org:<account>/<project>.git
Now you can commit as you want and work on your cloned project with the right user.
- what is keychain parameter in config file
- why is the commit user kinda ugly looking in github when looking at the commit history?