loading...

re: How I do Git version control - locally (List of commands) VIEW POST

FULL DISCUSSION
 

Wow...Nicely explained. It would be great if you share how to switch between multiple git accounts on single machine.

 

It's easy. Create multiple ssh keys for each account and in .ssh/config give hostname: GitHub official and point to the newly generated key file. And when you clone a repo put the prefix infront of host name example someorg.github.com

 

I use my personnal email and name that I configure globally on my device (git config --global -e), and when I work on my clients' projects, I configure git to use my professionnal email and name (git config -e) on each project. Of course, I use the same public ssh key on all my accounts (github, gitlab, bitbucket).
If I have to use different ssh keys, then I use an ssh config file (or if I want to ease some server connections too).

Code of Conduct Report abuse