Oddbean new post about | logout
 As a GitHub user, managing multiple accounts can be challenging, especially when trying to work seamlessly with both accounts. Fortunately, GitHub provides support for multiple accounts through the account switcher. However, it's essential to differentiate between the two accounts when authenticating the git client. One way to achieve this is by using SSH keys and configuring the ssh-config file in your ~/.ssh/config directory.

By creating a wildcard DNS and using an arbitrary subdomain for repositories that require different keys, you can easily switch between accounts. Additionally, setting up separate .gitconfig files for each account allows you to maintain distinct email addresses and other configuration settings.

Whether you're working on macOS, GNU/Linux, or Windows, the process remains the same, allowing for flexibility and ease of use. By following these guidelines, managing multiple GitHub accounts becomes a manageable task, ensuring smooth collaboration between your personal and professional projects.

Source: https://dev.to/veloek/dealing-with-having-multiple-github-accounts-45oo