{"id":5754,"date":"2024-09-27T08:27:08","date_gmt":"2024-09-27T08:27:08","guid":{"rendered":"https:\/\/gitprotect.io\/blog\/?p=5754"},"modified":"2024-09-27T08:27:12","modified_gmt":"2024-09-27T08:27:12","slug":"how-to-set-up-and-manage-multiple-github-accounts","status":"publish","type":"post","link":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/","title":{"rendered":"How To Set Up And Manage Multiple GitHub Accounts"},"content":{"rendered":"\n<p>Are you in between personal and work projects or maybe just managing multiple professional accounts from a single machine? Then, this article is here to help you simplify your Git configuration and management processes.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Managing multiple GitHub accounts on a single machine doesn&#8217;t have to be complicated. In this article, we will analyze the need for proper setup along with management of GitHub accounts and how it helps to protect important data which is often at risk of human error and cyber threats.&nbsp;<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Why would I need multiple GitHub accounts?&nbsp;<\/h2>\n\n\n\n<p>If you actually decide to set up multiple GitHub accounts, it can benefit you in a number of different ways, depending on your situation and requirements. Some individuals may take advantage of setting up more than one account because they need to separate their personal projects from their professional projects. Others may simply be open-source contributors and therefore require another account as you cannot use your managed user account to work on public <a href=\"https:\/\/gitprotect.io\/blog\/github-repository-vs-project\/\" target=\"_blank\" rel=\"noreferrer noopener\">projects on GitHub<\/a>.\u00a0<\/p>\n\n\n\n<p>Now, in terms of compliance, multiple accounts may support your compliance with organizational policies within your organization, as usually, your work account is for work-related purposes only. As a result, you can manage permissions effectively while keeping the personal and work-related repos separated but secure and access-restricted.&nbsp;<\/p>\n\n\n\n<p>Imagine if you had all of your personal and work-related repos under one account &#8211; it could raise a lot of issues. Another area where multiple GitHub accounts put you at an advantage is project management and collaboration. By separating different projects and using an account for a specific purpose, such as a work project with your team, you can easily manage project roles and notifications, as well as the aforementioned access controls. This way your work can be clear, organized, and collaborative.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Types of GitHub accounts&nbsp;<\/h2>\n\n\n\n<p>It is important to note that there are three types of GitHub accounts. These include user accounts, organization accounts, and enterprise accounts. Different types of accounts serve specific purposes and vary in terms of permissions.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">User accounts<\/h3>\n\n\n\n<p>When you sign into GitHub, you get a user account. Such an account can own repos, projects or packages. Also, any action you perform on GitHub &#8211; for example, a <a href=\"https:\/\/gitprotect.io\/blog\/pull-request-vs-merge-request-whats-the-difference\/\" target=\"_blank\" rel=\"noreferrer noopener\">pull request<\/a>, will be attributed to your user account. Although intended for humans, you can actually make accounts to automate tasks on GitHub. That would be called a machine user and could be used to automate continuous integration workflows. Furthermore, there are two different types of user accounts:\u00a0<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>A personal account <\/strong>is created when you sign up for your own account on GitHub.com. These use either GitHub Free or GitHub Pro plans. You can own an unlimited amount of public and private repos along with unlimited collaborators. Features vary depending on the chosen plan. When using multiple personal GitHub accounts they can be merged.\u00a0<\/li>\n\n\n\n<li><strong>A managed user account<\/strong> are created for you by an enterprise on <a href=\"https:\/\/gitprotect.io\/blog\/github-enterprise-server-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub Enterprise<\/a> Cloud. Your account settings and details are partially managed by the enterprise. In order to access any organizations or repos you must sign in to the managed account. Now, you can create private repositories, however creating public content or contributing to any repos outside the enterprise is not possible.\u00a0<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Organization accounts&nbsp;<\/h3>\n\n\n\n<p>These are accounts where a number of people can collaborate on different projects at the same time. However, you can\u2019t sign into an organization account, each individual has to log in using their user account and all actions made will be attributed to that account. There is no limit for user accounts on the number of organizations you can be a part of. In an organization, users can be granted different roles that define their levels of access controls. Only security managers and organization owners have permission to change the settings, admin features, and access controls. It\u2019s also possible to create sub-groups called teams for members to simplify access management.&nbsp;<\/p>\n\n\n\n<p>With organizations, there is no limit on the amount of public or private repositories that can be owned. As a free option, you can use GitHub Free, but if you want a complete set of features such as the SAML <a href=\"https:\/\/gitprotect.io\/blog\/saml-sso-in-terms-of-github-security\/\" target=\"_blank\" rel=\"noreferrer noopener\">single sign-on<\/a>, there is GitHub Team or GitHub Enterprise Cloud.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enterprise accounts&nbsp;<\/h3>\n\n\n\n<p>In terms of enterprise accounts, you get <a href=\"https:\/\/gitprotect.io\/features\/management\/centralized-management.html\" target=\"_blank\" rel=\"noreferrer noopener\">centralized management<\/a> for multiple organizations. Admins for such accounts are able to manage enterprise membership and billing along with usage. Other permissions include security configurations, like SSO, listing the allowed IP addresses, 2FA, and SSH certificates. Administrators can also enforce policies and make use of <a href=\"https:\/\/gitprotect.io\/blog\/github-copilot-introduction-an-ai-assisted-coding\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub Copilot<\/a> along with Advanced Security.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Authentication methods for GitHub accounts&nbsp;<\/h2>\n\n\n\n<p>In terms of using multiple GitHub accounts, security is especially important. There must be a relevant way to authenticate users and access permissions. The majority of <a href=\"https:\/\/gitprotect.io\/blog\/git-and-why-version-control-systems-are-now-more-critical-than-ever\/\" target=\"_blank\" rel=\"noreferrer noopener\">Version Control Systems<\/a> platforms, like GitHub, support two primary methods of authentication:\u00a0<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SSH &#8211; Secure Shell<\/li>\n\n\n\n<li>HTTPS &#8211; Hypertext Transfer Protocol Secure<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">A few words about HTTPS&nbsp;<\/h3>\n\n\n\n<p>When it comes to <a href=\"https:\/\/gitprotect.io\/blog\/how-to-clone-using-https-in-git\/\" target=\"_blank\" rel=\"noreferrer noopener\">HTTPS<\/a> you will mainly use it due to its simplicity and the fact that it&#8217;s built directly into the HTTP protocol. However, there is a catch &#8211; it requires you to input your credentials again every single time you try to clone, pull, or push to a repository (unless you are using a credential helper). This can be less secure, especially if you&#8217;re managing multiple accounts.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prioritize SSH for security and simplicity&nbsp;<\/h3>\n\n\n\n<p>Now, let\u2019s go over some details of <a href=\"https:\/\/gitprotect.io\/blog\/how-to-clone-using-ssh-in-git\/\" target=\"_blank\" rel=\"noreferrer noopener\">SSH<\/a>. Contrary to HTTPS, it is more secure and convenient. It uses a pair of cryptographically linked keys &#8211; a public and a private key. As we mentioned already, your public key will be shared and will encrypt relevant data, which can only be decrypted with your private key. Therefore, the key (pun intended) to maintaining security is to never reveal your private key and keep it secret as it is the only entity capable of decrypting your data.<\/p>\n\n\n\n<p>This method is much simpler to use when compared to HTTPS because it doesn&#8217;t ask you to enter your credentials every time you push or pull from the repo, as authentication is handled through those keys. The way it works is that it is able to remember your identity through the ssh-agent &#8211; a program, which runs in the background and keeps your private key ready for continuous use. This approach can simplify your workflows and boost your cyber defenses by using cryptographic key-based authentication rather than well-known, traditional password-based methods. Therefore, if you use SSH keys you are more protected against cyber attacks and guarantee that your connections are always encrypted.&nbsp;<\/p>\n\n\n\n<p>To recap, while both HTTPS and SSH have their own purposes and uses, SSH is preferred for its security and convenience, especially for developers managing multiple GitHub accounts. It is important to understand the technical aspects of the possible authentication methods so that you can make an informed decision that will best suit your workflow and security needs.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Set up multiple GitHub accounts with SSH for easier management<\/h2>\n\n\n\n<p>As we discussed, at some point in your developer journey you may face the need to set up and then manage more than one GitHub account. To set up your multiple GitHub accounts with SSH keys there are several steps you will need to follow.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#1 Generating your SSH key<\/h3>\n\n\n\n<p>First of all, you will have to make sure that your current directory is in your .ssh folder, that is done through:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>\u2018$ cd ~\/.ssh\u2019<\/em>\u00a0<\/li>\n<\/ul>\n\n\n\n<p>Start off by generating a pair of SSH keys. You have two possible options to choose from, depending on the security and performance you need:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For ED25519 (recommended for greater security and performance):\u00a0<\/li>\n<\/ul>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><em>\u2018ssh-keygen -t ed25519 -C &#8220;your_email@example.com&#8221; -f ~\/.ssh\/descriptive_key_name<\/em>\u2019&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For RSA (a valid alternative provided it is long enough):\u00a0<\/li>\n<\/ul>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><em>\u2018ssh-keygen -t rsa -b 4096 -C &#8220;your_email@example.com&#8221; -f ~\/.ssh\/descriptive_key_name\u2019<\/em><\/p>\n\n\n\n<p>Next, add a descriptive name and associated email to enhance manageability. The <em>\u2018-C\u2019<\/em> option stands for comment (usually your email) to help you locate your SSH key, and <em>\u2018-f\u2019<\/em> is the filename in which your key will be saved.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#2 Securing your key with a passphrase&nbsp;<\/h3>\n\n\n\n<p>Our next step is optional but it can improve your security. Adding a passphrase to your SSH key during creation is beneficial because if it gets compromised, the key remains protected unless someone has access to your passphrase. To update the passphrase use the command:&nbsp;<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><em>\u2018ssh-keygen -p -f ~\/.ssh\/descriptive_key_name\u2019<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#3 Saving keys with ssh-agent&nbsp;<\/h3>\n\n\n\n<p>To avoid having to enter your passphrase every time, you can use the ssh-agent to store your passphrase, the command will look like that:<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><em>\u2018eval &#8220;$(ssh-agent -s)&#8221; &amp;&amp; \\<\/em><br><em>ssh-add -K ~\/.ssh\/descriptive_key_name\u2019\u00a0<\/em><\/p>\n\n\n\n<p>Keep in mind that the \u201c-K\u201d option which stores your passphrase in the keychain is only for macOS.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#4 Craft your SSH config<\/h3>\n\n\n\n<p>Create a \u2018<em>.ssh\/config\u2019<\/em> file (unless you have one already). We set \u201cHost\u201d to \u201c*\u201d for all keys. This will allow Git to specify which SSH key to use based on different profiles:&nbsp;<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><em>Host *<\/em><br>   <em>AddKeysToAgent yes<\/em><br>   <em>UseKeychain yes<\/em><br>   <em>IdentityFile ~\/.ssh\/&lt;created_key>\u00a0<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#5 Distributing your public key&nbsp;<\/h3>\n\n\n\n<p>Copy your public key to your clipboard and add it to your <a href=\"https:\/\/gitprotect.io\/blog\/github-organizations-best-practices\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub organization<\/a>:\u00a0<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>macOS: <em>\u2018tr -d &#8216;\\n&#8217; &lt; ~\/.ssh\/descriptive_key_name.pub | pbcopy\u2019<\/em><\/li>\n\n\n\n<li>Linux: <em>\u2018xclip -sel clip &lt; ~\/.ssh\/descriptive_key_name.pub\u2019<\/em><\/li>\n\n\n\n<li>Windows: <em>\u2018cat ~\/.ssh\/descriptive_key_name.pub | clip\u2019<\/em><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">#6 Organizing your workspace&nbsp;<\/h3>\n\n\n\n<p>Next, you should create a corresponding .gitconfig file within its workspace directory for each account to replace user settings with specific configurations.&nbsp;<\/p>\n\n\n\n<p>Assuming your directory looks like this:\u00a0<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><em>\/myhome\/<\/em><br><em>\u00a0\u00a0\u00a0\u00a0|__.gitconfig<\/em><br><em>\u00a0\u00a0\u00a0\u00a0|__work\/<\/em><br><em>\u00a0\u00a0\u00a0\u00a0|__personal\/<\/em><\/p>\n\n\n\n<p>You should create two different .gitconfig files for each of your directories, take a look:&nbsp;<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><em>\/myhome\/<\/em><br><em>\u00a0\u00a0\u00a0\u00a0|__.gitconfig<\/em><br><em>\u00a0\u00a0\u00a0\u00a0|__work\/<\/em><br><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|__.gitconfig.work<\/em><br><em>\u00a0\u00a0\u00a0\u00a0|__personal\/<\/em><br><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|__.gitconfig.pers\u00a0<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#7 Customizing your Git configs&nbsp;<\/h3>\n\n\n\n<p>Now, we will specify which SSH key Git should use for connecting to remote repositories. We clearly outline in Git which SSH key should be used for each project or a set of projects (work or personal) directly in Git configuration files. By doing so, the management of multiple accounts gets easier. Imagine if you have multiple GitHub accounts and they both use \u2018github.com\u2019 as the host &#8211; it may end up being overly complicated. If you were to manage different SSH keys in one single SSH config file you would have to create hostnames, such as \u201cother.github.com\u201d. Then, whenever you want to <a href=\"https:\/\/gitprotect.io\/blog\/how-to-clone-a-git-repository\/\" target=\"_blank\" rel=\"noreferrer noopener\">clone a repo<\/a> you will have to use that other hostname and not \u201cgithub.com\u201d. As you can see this brings a couple of issues like the need to create and remember these arbitrary prefixes to make hostnames &#8211; which is not easy. Also, there is a threat of forgetting which hostname to use, which leads to even more mistakes and confusion.\u00a0<\/p>\n\n\n\n<p>Take a look at how your config could potentially look like (the \u201c-i\u201d option is for specifying the identity file, which is your SSH key):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Work:\u00a0<\/li>\n<\/ul>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><em># ~\/work\/.gitconfig.work<\/em><br><em>[user]<\/em><br><em>email = work_email@google.com<\/em><br><em>name = Your Name<\/em><br><em>[github]<\/em><br><em>user = &#8220;work_name&#8221;<\/em><br><em>[core]<\/em><br><em>sshCommand = &#8220;ssh -i ~\/.ssh\/&lt;professional_key>&#8221;<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Personal:<\/li>\n<\/ul>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><em># ~\/personal\/.gitconfig.pers<\/em><br><em>[user]<\/em><br><em>email = personal_email@example.com<\/em><br><em>name = Your Name<\/em><br><em>[github]<\/em><br><em>user = &#8220;myusername&#8221;<\/em><br><em>[core]<\/em><br><em>sshCommand = &#8220;ssh -i ~\/.ssh\/&lt;personal_key>&#8221;<\/em><\/p>\n\n\n\n<p><strong>\ud83d\udca1 This guarantees Git uses the correct SSH key for each of your accounts.&nbsp;<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#8 Implementing global configurations&nbsp;<\/h3>\n\n\n\n<p>Next, you can take advantage of the global <em>\u2018.gitconfig\u2019<\/em> to include common settings, such as your name. The <em>\u2018includeIf\u2019 <\/em>directive allows you to automatically apply different configurations based on the location of your directory.&nbsp;<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><em># ~\/.gitconfig<\/em><br><em>[includeIf &#8220;gitdir:~\/personal\/&#8221;] # include for all .git projects under personnal\/\u00a0<\/em><br><em>path = ~\/personal\/.gitconfig-pers<\/em><br><em>[includeIf &#8220;gitdir:~\/work\/&#8221;]<\/em><br><em>path = ~\/work\/.gitconfig-work\u00a0<\/em><br><em>[core]<\/em><br><em>excludesfile = ~\/.gitignore\u00a0 \u00a0 \u00a0 # valid everywhere\u00a0<\/em><\/p>\n\n\n\n<p><strong>\ud83d\udca1 Now, you can replicate this process for all of your accounts and enjoy the simplification that you have added to your workflow!&nbsp;<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Additional tips<\/h3>\n\n\n\n<p>Always double-check your configurations with <em>\u2018git config &#8211;list\u2019<\/em> to guarantee that the correct settings are applied.&nbsp;<\/p>\n\n\n\n<p>Use the \u2018<em>ssh-keygen -l -f ~\/.ssh\/descriptive_key_name.pub\u2019<\/em> command in order to verify if your public key has been correctly generated and added.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What about multiple GitHub account management using CLI<\/h2>\n\n\n\n<p>As an option, you can use GitHub CLI for multiple account management. You need to download and install GitHub CLI on your device. Once that is done, you can set up and switch between multiple accounts in a streamlined way.&nbsp;Thus, you should:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Authenticate your GitHub accounts<\/strong> with <em>\u2018gh auth login\u2019 <\/em>and follow the authentication process. You must run this command for each of the accounts you want to manage.\u00a0<\/li>\n\n\n\n<li><strong>Switch between accounts<\/strong> using <em>\u2018gh auth switch [username]\u2019<\/em>. This could greatly simplify the process of switching accounts. Remember to replace \u201c<em>[username]<\/em>\u201d with the login credentials of the relevant account.\u00a0<\/li>\n\n\n\n<li>To correctly <strong>set up Git configuration<\/strong> for each repository use <em>\u2018gh auth setup-git\u2019<\/em>. Based on the authenticated account, the aforementioned command will set up relevant Git configuration for your current repo. You may need to run\u00a0 <em>\u2018gh auth setup-git\u2019<\/em> in your repository directory, if your commits are not being attributed to the desired account.\u00a0<\/li>\n\n\n\n<li><strong>Clone repositories<\/strong> through the use of <em>\u2018gh repo clone repository_url\u2019 <\/em>command. Make sure to replace \u201c<em>repository_url\u201d <\/em>with the relevant URL. Since you can easily authenticate accounts and switch between them, it is rather simple to clone your repository (using the account that is currently active, or change to another one using <em>\u2018gh auth switch\u2019<\/em>).\u00a0<\/li>\n\n\n\n<li>To <strong>verify<\/strong> which of the accounts is currently active run <em>\u2018gh auth status\u2019<\/em>. This way you will be able to see details regarding the currently authenticated account whenever you need to.\u00a0<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Secure your GitHub accounts with automated backups&nbsp;<\/h2>\n\n\n\n<p>One more thing &#8211; you should never forget about the security of your GitHub account. There are a lot of threats that your GitHub may face &#8211; cyber and ransomware attacks, vulnerabilities, outages, accidental deletions &#8211; you may learn about them in <a href=\"https:\/\/gitprotect.io\/the-state-of-devops-threats-report.html?utm_source=bg&amp;utm_medium=bg\" target=\"_blank\" rel=\"noreferrer noopener\">the State of DevOps Threats Report<\/a>. How to <a href=\"https:\/\/gitprotect.io\/blog\/is-github-a-safe-place-for-your-source-code\/\" target=\"_blank\" rel=\"noreferrer noopener\">secure your GitHub<\/a> repository and metadata? Follow <a href=\"https:\/\/gitprotect.io\/blog\/github-security-best-practices-15-tips-to-keep-in-mind\/\" target=\"_blank\" rel=\"noreferrer noopener\"><u>GitHub security best practices<\/u><\/a>, including shifting security left, continuous vulnerability testing and scanning, and back up your GitHub account, etc.<\/p>\n\n\n\n<p>GitProtect.io will provide you with <a href=\"https:\/\/gitprotect.io\/blog\/github-backup-best-practices\/\" target=\"_blank\" rel=\"noreferrer noopener\"><u>backup best practices<\/u><\/a>, including complete coverage of all your repos and metadata. Moreover, thanks to point-in-time restore and <a href=\"https:\/\/gitprotect.io\/features\/data-restore-disaster-recovery\/granular-restore.html\" target=\"_blank\" rel=\"noreferrer noopener\">granular restore<\/a> features, if you are affected by ransomware, hardware failures or unauthorized access leading to data loss, the downtime will be minimal and you will be able to quickly recover data to continue your workflow. Additionally, if your organization is in one of the regulated industries such as healthcare, government or financial services, then you are most likely obligated to keep backups (usually with long or even unlimited <a href=\"https:\/\/gitprotect.io\/blog\/the-importance-of-data-retention-policies-in-devops-backup-and-recovery\/\" target=\"_blank\" rel=\"noreferrer noopener\">retention<\/a>) of critical data for compliance purposes, for example for archiving.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary&nbsp;<\/h2>\n\n\n\n<p>Well, now you can take advantage of this simplified method to manage different GitHub accounts on one machine. Use the SSH keys to set up your multiple accounts, customize your configs and as a result, save yourself time and guarantee that you will not have to scratch your head to remember your hostnames every time you clone a repo. We advise you to complement your workflow with a robust backup solution to secure your GitHub environments, repos, accounts, and metadata for complete security!<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><a href=\"https:\/\/gitprotect.io\/sign-up.html\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>[FREE TRIAL] Ensure compliant DevOps backup and recovery with a 14-day trial<\/strong><\/a><strong>\u00a0\ud83d\ude80<\/strong><br><a href=\"https:\/\/calendly.com\/d\/3s9-n9z-pgc\/gitprotect-live-demo?month=2024-08\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>[CUSTOM DEMO] Let\u2019s talk about how backup &amp; DR software for DevOps can help you mitigate the risks<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you in between personal and work projects or maybe just managing multiple professional accounts from a single machine? Then, this article is here to help you simplify your Git configuration and management processes.<\/p>\n","protected":false},"author":12,"featured_media":5755,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-5754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-github","post--single"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Set Up And Manage Multiple GitHub Accounts - Blog | GitProtect.io<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Set Up And Manage Multiple GitHub Accounts - Blog | GitProtect.io\" \/>\n<meta property=\"og:description\" content=\"Are you in between personal and work projects or maybe just managing multiple professional accounts from a single machine? Then, this article is here to help you simplify your Git configuration and management processes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog | GitProtect.io\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/XoperoSoftware\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-27T08:27:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-27T08:27:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/09\/4-1-1024x512.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GitProtectio\" \/>\n<meta name=\"twitter:site\" content=\"@GitProtectio\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/\"},\"author\":{\"name\":\"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/3404d5bf8d1a1c26abb51a4c2cacbc05\"},\"headline\":\"How To Set Up And Manage Multiple GitHub Accounts\",\"datePublished\":\"2024-09-27T08:27:08+00:00\",\"dateModified\":\"2024-09-27T08:27:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/\"},\"wordCount\":2592,\"publisher\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/09\/4-1.png\",\"articleSection\":[\"GitHub\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/\",\"name\":\"How To Set Up And Manage Multiple GitHub Accounts - Blog | GitProtect.io\",\"isPartOf\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/09\/4-1.png\",\"datePublished\":\"2024-09-27T08:27:08+00:00\",\"dateModified\":\"2024-09-27T08:27:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#primaryimage\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/09\/4-1.png\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/09\/4-1.png\",\"width\":2400,\"height\":1200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Strona g\u0142\u00f3wna\",\"item\":\"https:\/\/gitprotect.io\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Set Up And Manage Multiple GitHub Accounts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#website\",\"url\":\"https:\/\/gitprotect.io\/blog\/\",\"name\":\"GitProtect.io Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/gitprotect.io\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\",\"name\":\"GitProtect.io\",\"url\":\"https:\/\/gitprotect.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png\",\"width\":528,\"height\":528,\"caption\":\"GitProtect.io\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/XoperoSoftware\/\",\"https:\/\/x.com\/GitProtectio\",\"https:\/\/www.linkedin.com\/company\/xopero-software\/\",\"https:\/\/www.youtube.com\/channel\/UCiEnl6n0mIO6w7twccz-l2w\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/3404d5bf8d1a1c26abb51a4c2cacbc05\",\"name\":\"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/08\/milosz-jesis-technical-content-writer-at-gitprotect.io_avatar-96x96.png\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/08\/milosz-jesis-technical-content-writer-at-gitprotect.io_avatar-96x96.png\",\"caption\":\"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io\"},\"description\":\"Milosz is Technical Content Writer at GitProtect, demonstrating fluency in both Polish and English, and a passion for language and technology. Currently pursuing a degree in Philosophy at UWE Bristol, he excels in creating engaging technical content that bridges the gap between users and the emerging technologies. Milosz leverages his writing skills and technical knowledge to author articles and blog posts, with a focus on DevOps, cyber-security, and potential cyber-threats, among other crucial IT topics. Additionally, valuable translations provided by Milosz further enhance GitProtect's communication and global outreach.\",\"url\":\"https:\/\/gitprotect.io\/blog\/author\/milosz-jesis\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Set Up And Manage Multiple GitHub Accounts - Blog | GitProtect.io","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/","og_locale":"en_US","og_type":"article","og_title":"How To Set Up And Manage Multiple GitHub Accounts - Blog | GitProtect.io","og_description":"Are you in between personal and work projects or maybe just managing multiple professional accounts from a single machine? Then, this article is here to help you simplify your Git configuration and management processes.","og_url":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/","og_site_name":"Blog | GitProtect.io","article_publisher":"https:\/\/www.facebook.com\/XoperoSoftware\/","article_published_time":"2024-09-27T08:27:08+00:00","article_modified_time":"2024-09-27T08:27:12+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/09\/4-1-1024x512.png","type":"image\/png"}],"author":"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io","twitter_card":"summary_large_image","twitter_creator":"@GitProtectio","twitter_site":"@GitProtectio","twitter_misc":{"Written by":"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#article","isPartOf":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/"},"author":{"name":"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/3404d5bf8d1a1c26abb51a4c2cacbc05"},"headline":"How To Set Up And Manage Multiple GitHub Accounts","datePublished":"2024-09-27T08:27:08+00:00","dateModified":"2024-09-27T08:27:12+00:00","mainEntityOfPage":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/"},"wordCount":2592,"publisher":{"@id":"https:\/\/gitprotect.io\/blog\/#organization"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#primaryimage"},"thumbnailUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/09\/4-1.png","articleSection":["GitHub"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/","url":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/","name":"How To Set Up And Manage Multiple GitHub Accounts - Blog | GitProtect.io","isPartOf":{"@id":"https:\/\/gitprotect.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#primaryimage"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#primaryimage"},"thumbnailUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/09\/4-1.png","datePublished":"2024-09-27T08:27:08+00:00","dateModified":"2024-09-27T08:27:12+00:00","breadcrumb":{"@id":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#primaryimage","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/09\/4-1.png","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/09\/4-1.png","width":2400,"height":1200},{"@type":"BreadcrumbList","@id":"https:\/\/gitprotect.io\/blog\/how-to-set-up-and-manage-multiple-github-accounts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Strona g\u0142\u00f3wna","item":"https:\/\/gitprotect.io\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Set Up And Manage Multiple GitHub Accounts"}]},{"@type":"WebSite","@id":"https:\/\/gitprotect.io\/blog\/#website","url":"https:\/\/gitprotect.io\/blog\/","name":"GitProtect.io Blog","description":"","publisher":{"@id":"https:\/\/gitprotect.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gitprotect.io\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/gitprotect.io\/blog\/#organization","name":"GitProtect.io","url":"https:\/\/gitprotect.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png","width":528,"height":528,"caption":"GitProtect.io"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/XoperoSoftware\/","https:\/\/x.com\/GitProtectio","https:\/\/www.linkedin.com\/company\/xopero-software\/","https:\/\/www.youtube.com\/channel\/UCiEnl6n0mIO6w7twccz-l2w"]},{"@type":"Person","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/3404d5bf8d1a1c26abb51a4c2cacbc05","name":"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/08\/milosz-jesis-technical-content-writer-at-gitprotect.io_avatar-96x96.png","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/08\/milosz-jesis-technical-content-writer-at-gitprotect.io_avatar-96x96.png","caption":"Mi\u0142osz Jesis, Technical Content Writer at GitProtect.io"},"description":"Milosz is Technical Content Writer at GitProtect, demonstrating fluency in both Polish and English, and a passion for language and technology. Currently pursuing a degree in Philosophy at UWE Bristol, he excels in creating engaging technical content that bridges the gap between users and the emerging technologies. Milosz leverages his writing skills and technical knowledge to author articles and blog posts, with a focus on DevOps, cyber-security, and potential cyber-threats, among other crucial IT topics. Additionally, valuable translations provided by Milosz further enhance GitProtect's communication and global outreach.","url":"https:\/\/gitprotect.io\/blog\/author\/milosz-jesis\/"}]}},"_links":{"self":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/5754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/comments?post=5754"}],"version-history":[{"count":2,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/5754\/revisions"}],"predecessor-version":[{"id":5758,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/5754\/revisions\/5758"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/media\/5755"}],"wp:attachment":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/media?parent=5754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/categories?post=5754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/tags?post=5754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}