If you need to use multiple accounts on GitHub, you can sign in to your accounts and switch between them without always being required to reauthenticate. You can use the account switcher if you have a personal account and service accounts (sometimes called machine users) or if you need to switch between your personal account and managed user accounts in an enterprise that uses Enterprise Managed Users.

This short video can walk you through the process.

🌐
Medium
aprilescobar.medium.com › switching-github-accounts-on-visual-studio-code-with-a-macbook-3fc0207a6638
Switching Github Accounts on Visual Studio Code with a MacBook | by April Escobar | Medium
April 5, 2021 - This one is pretty easy. Sign out of your current account (e.g. company account). Sign into the account with the appropriate access to the repositories you need (e.g. personal account).
🌐
Bobby Hadz
bobbyhadz.com › blog › change-git-user-or-github-account-in-vscode
Changing the Git user or the GitHub account in VS Code | bobbyhadz
April 5, 2024 - Push your code to GitHub to get prompted to enter your new credentials. ... Click on the profile icon in the bottom left corner. Hover over your Github username. Click on the Sign Out button.
Discussions

how to change github accounts
Select Topic Area Question Body My company bought me a copilot license. I signed up with github using my work address and added that acount to visual studio. Now there doesnt appear to be a way to ... More on github.com
🌐 github.com
3
1
April 22, 2025
How to change GitHub Account in Visual Studio Code - Stack Overflow
I have my first GitHub account logged in my Visual Studio Code. A window popped out and I logged in my GitHub credentials there and after that I configured my credentials using the git config --glo... More on stackoverflow.com
🌐 stackoverflow.com
I have 2 GitHub accounts. How can I use both when I am working in VS Code? - Stack Overflow
If you choose to add a new account, ... to the GitHub website to sign in (or select an account that is already signed in). After signing in and authorizing access, you will be redirected back to VS Code (click "Open Visual Studio Code" if prompted). The selected account will then be added to VS Code. If you do not want to add a new account and only want to change the account ... More on stackoverflow.com
🌐 stackoverflow.com
How do you use different GitHub accounts in VSCode?
Have you tried VS Code profiles? More on reddit.com
🌐 r/vscode
11
2
November 2, 2023
🌐
Medium
medium.com › @successkillsall266 › how-to-change-the-github-account-in-vs-code-terminal-for-windows-users-6908dbe415ff
How to change the GitHub account in VS Code/Terminal for Windows users?
December 24, 2025 - 3. Edit or Remove: Open it and change the username and password (or Personal Access Token) to your second GitHub account. Alternatively, just remove the entry entirely. 4. Restart: Restart your terminal or VS Code (a full system restart is usually ...
Top answer
1 of 16
72


LIST of MAJOR REVISION DATES

      EDIT 1: 2021-06-06       •       EDIT 2: 2021-07-15       •       EDIT 3: 2022/05/21

This question has been edited several times to keep it useful, and current. The most recent edit was on September 14th of 2022 at approx 10am UTC. There have been 3 major edits (or revisions is probably the more appropriate term to use here), that were necessary in order to keep this answer relevant and up to date. The revisions were prompted by changes to the UI and changes to GitHub's own defined protocol that defines the login process (I am specifically referring to GitHub now requiring a PAT security token to be used to authenticate anything pushed using the HTTPS protocol). The most important thing to note is as of 2022/09/14, this is a working answer.



This Q&A Contains 2 Questions.

The first question can be answered very quickly, whereas, Question-#2 will require far more explanation and contains the answer that you'll likely be looking for.


The 1st question ("Question #1") asks:

  • Is it possible to log into two GitHub accounts at the same time in V.S. Code?

ANSWER #1

  • No! You Cannot Log into 2 GitHub Accounts at the Same Time.



The 2nd question ("Question #2") asks:

  • (Q) Does V.S. Code have a quick & easy mechanism built into its UI for switching between GitHub accounts?

  • (A) YES IT DOES! VS Code has an icon on the "activity-bar" that can be used for logging in & out of your GitHub & Microsoft accounts. I will go into detail about this below.



Step-1: Install the Following Extensions


You should have a couple extensions that help to automate the login process, which now requires a PAT (even in the CmdL). And that also help with organizing the user.name and user.email that you use for each project. Bellow are the 2 extension you need.



  1. "GitHub Pull Requests & Issues Extension"
  • Link to open in VS Code: vscode:extension/GitHub.vscode-pull-request-github

  • REASON 4 INSTALLING - This is a GitHub extension that everyone using GitHub should use, but it also does something to help with Terminal integration that enables UI and CLIs to co-exist. The last sentence was nearly word for word from the extensions description. To be more concise, installing it will help to automate the login process to GitHub. Upon installing it will likely prompt you to log into GitHub. If that is the case, then YES LOG IN


  1. GIT-AutoConfig
  • _"Git-Autoconfig automatically sets credentials for each new project you clone, &/or create. It also prompts you when you open your projects to make sure that the project is configured with the correct user.name & user.email. When using two GitHub accounts it is critical that you configure each project specifically for the account it belongs to. If a project accidentally gets configured for the wrong project, bad things happen, and lots of time is wasted.

  • This extension needs to be configured. The extension attempts to auto-configure each project, but in-case, you feel a project isn't configured, or is configured incorrectly, you can hit the F1 key to drop open the "Quick Input Menu". With the menu open, type "git autoconfig set". When you see an option that reads, "Set Config", select it, and follow the 2-part instructions.

A HELPFUL TIP:

When "Git-AutoConfig" prompts you, if the setting below is configured in your user-scoped "settings.json" file, then you can select a pr-configured input, rather than manually typing the input each time.

    /**
     * @file "settings.json"
     * @desc "This is what my configuration looks like" */

    "git-autoconfig.configList": [
         {
              "user.email": "W3Dojo@gmail.com",
              "user.name": "jD3V"
          },
          {
              "user.email": "AndrewJay.zck@gmail.com",
              "user.name": "JAYD3V"
          }
    ]


Restart V.S. Code

Before continuing to Step-2, please restart your editor, so the menu we use below recognizes the GitHub extension you installed.



Step-2: Configuring your Git settings using the Git CLI


We are going to continue forward from the Welcome Page, as being in a project configured for the wrong GitHub account can screw something up. FYI, you want to make sure you are logged into the correct account when bouncing from one project to the next. You don't want to enter a project for one account, when your logged into another account. It can really confuse VS Code, and even more so, VS Code Extensions. Oh, and Git, the software that VS Code uses to make all of this work.

To get to the Welcome page, preform the following steps:
  1. Choosing "FILE" from the title-bar menu.
  2. Choose "CLOSE FOLDER" from the file-menu.
  3. You should now be at the VS Code welcome page, this is a good neutral place to start.

It might sound like I am being finicky, but I want this to work for you, and anything involving Git, can get screwed up very badly, very easily.



Step-3: The Account Context Menu


We will use the "Account Context Menu" to log out of any GitHub accounts your logged into. Click on the icon located at the very bottom of your Activity-bar.


The image below shows the selections to choose for logging out. If you are not logged into any GitHub accounts, then that's fine. Just carry on.



Step-4: Configuring Git

In your head, think of the GitHub account your going to log into.

Now, execute the following commands with the correct values for the account you are going to use to log in.

~$ git config --global user.name "urGitHubUsrName"
~$ git config --global user.email "urGitHubEmail@foobar.com"

~$ git config --local user.name "urGitHubUsrName"
~$ git config --local user.email "urGitHubEmail@foobar.com"


Step-5: Logging In

PLEASE NOTE: You are going to log in twice!

  1. First, Click the "Account Context Menu"
  2. With the menu open choose the option that says "Sign-in to Sync Settings" as shown in the image below.
  3. It will let you choose between signing in with Microsoft or GitHub. With this login, you can choose either, but I by far prefer to use my GitHub account, as I use Linux. Depending on what you have done in VS Code in the past, you may need to use to copy & paste a PAT for authentication.
  4. After signing in to MS/GH for syncing settings, Click the "Account Context Menu" again. This time choose "Sign-in: GitHub Pull-request & Issues". Follow instructions. Image bellow shows both options




Now the reason I had you use the settings sync with the GitHub Pull-request & issues extension is for two reasons.

  1. If you use a different GitHub account for each one, you will be auto-logged out of the other. In other words, if you log into the GH extension using account A, while you already logged into settings sync with account B, account B gets logged out. This isn't all, it creates confusion, trust me when I say you want to avoid the confusion when your working in your projects.

  2. Each GitHub account has its own settings synced for it. This includes settings, keybindings, snippets, ect... This way if you have one for work, and one for personal, you can manage different settings. Usually a Company GitHub account will be used by other people in the company, meaning you will have to use certain settings. This method will prevent you from having to change your personal configuration.


LASTLY

To login to another account, just repeat the steps. It may seem slow the first time you do it, but I log in and out in literally, about 10 seconds now. Cheers from Nor Cal!


2 of 16
33

Configuring 2 (or multiple) GitHub accounts on VSCode. Without signing in and out everytime.

  1. Click Profile Icon on the sidebar. Click your account on GitHub and click Manage Trusted Extensions.

  2. Click on the gear icon next to GitHub.

  3. Now click on Use new account

  4. This should now redirect you to a browser. Now simply login using your new account.

Note: This will only sign you in to the 'GitHub' extension on VSCode. (This extension is used to view, clone repos you have access from your accounts. This extension is not a replacement for 'git'. So, you still may run into access errors when trying push/pull commits. To complete the configuration, follow the steps below)

Full Git and GitHub integration for multiple accounts using Official GitHub CLI

  1. Download and install the GitHub CLI from https://cli.github.com/

  2. On your command line type the below command and login using your first account.

    $ gh auth login
    
  3. Repeat the above step for your second account.

  4. Type the below command and you should see both your accounts in a similar output. (Active account indicates the account which is currently authenticated to perform git actions through the CLI)

    $ gh auth status
    
    github.com
     ✓ Logged in to github.com account first_account_username (keyring)
     - Active account: true
     - Git operations protocol: https
     - Token: gho_************************************
     - Token scopes: 'gist', 'read:org', 'repo', 'workflow'
    
     ✓ Logged in to github.com account second_account_username (keyring)
     - Active account: false
     - Git operations protocol: https
     - Token: gho_************************************
     - Token scopes: 'gist', 'read:org', 'repo', 'workflow'
    
  5. Use the following to switch between accounts:

    $ gh auth switch
    

    If you have multiple accounts setup, specify the username, eg:

    $ gh auth switch -u second_account_username
    
  6. Before making any commits on repos on different accounts make sure git is using the appropriate username and email to author the commits. (It is better to have git configured globally for the account you use often on your PC and change the username and email for specific repos)

    To configure the username and email for a specific repository:

    $ git config --local user.email "first_account@example.com"
    $ git config --local user.name"first_account_username"
    

    You can also use an extension on VSCode to manage your configs. eg: git-autoconfig

  7. Finally, you should be able to freely use multiple GitHub accounts on VSCode, or anywhere to be precise, using gh auth switch and git config ...

  8. If your still encountering permission issues, it's likely that git isn't configured to use the GitHub CLI as its credential helper. You may run into this issue when either first clone a repo, or use a repo that was created before you installed GitHub CLI. Reference Use:

    $ gh auth setup-git
    
Find elsewhere
🌐
Brainly
brainly.com › computers and technology › high school › how do you switch github accounts in vs code?
[FREE] How do you switch GitHub accounts in VS Code? - brainly.com
To switch GitHub accounts in Visual Studio Code (VSCode), you'll need to sign out of the current GitHub account and sign in with the one you wish to use.
🌐
Reddit
reddit.com › r/vscode › how do you use different github accounts in vscode?
r/vscode on Reddit: How do you use different GitHub accounts in VSCode?
November 2, 2023 -

Hi all.

Well this is frustrating. I've searched for this and there seems to be a myriad of different answers but none seem to have effectively worked.

I need to login to different GitHub accounts with VSCode but it seems to "stick" on one every time I try to logout and log back in using the "Sign in with GitHub".

Has anyone figured out a decent way to manage multiple GitHUb accounts with VSCode?

Cheers.

🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Git Account Switch - Visual Studio Marketplace
March 22, 2026 - Extension for Visual Studio Code - Clear GitHub credentials in one click
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
GitShift - Visual Studio Marketplace
November 3, 2025 - Extension for Visual Studio Code - Manage and seamlessly switch between multiple GitHub accounts within VS Code. Easily handle authentication, commit and push as different users, use personal access tokens, and keep your Git configuration in sync across workspaces.
🌐
GitHub
github.com › orgs › community › discussions › 157518
How to switch copilot account in vscode · community · Discussion #157518 · GitHub
April 25, 2025 - Alternative via Command Palette: Press Ctrl+Shift+P (Windows/Linux) or ⌘+Shift+P (Mac). Type and run GitHub: Sign Out to disconnect any GitHub identity.​ 2. (If needed) Clear cached credentials: Note: If signing out does not prompt you to ...
🌐
Reddit
reddit.com › r/vscode › i built a vs code extension to manage multiple github accounts - never commit with the wrong identity again!
r/vscode on Reddit: I built a VS Code extension to manage multiple GitHub accounts - never commit with the wrong identity again!
November 2, 2025 -

As someone juggling personal projects, work repos, and open source contributions, I was constantly switching between GitHub accounts. I'd forget to change my git config and accidentally commit with my work email on personal projects (or vice versa). 😅

So I built GitShift
- a VS Code extension that lets you seamlessly switch between multiple GitHub accounts right from the sidebar.

Key Features:

- One-click account switching (personal ↔ work ↔ org accounts)
- GitHub authentication support with secure token storage
- Visual account manager in the Activity Bar
- View your GitHub contributions graph
- GitHub notifications integration
- Auto-configures git credentials when you switch
- Workspace-specific configurations

How it works:

1. Sign in with your GitHub accounts (or add Personal Access Tokens)
2. Click an account in the sidebar to switch instantly
3. Your git config updates automatically - commit and push with confidence!

The extension automatically sets `git config user.name` and `git config user.email` per workspace, so you never accidentally commit with the wrong identity again.

You can get it from the VS Code Marketplace or check out the GitHub repo.

I'd love your feedback! What features would make this more useful for your workflow?

🌐
Medium
medium.com › @abhaykanwasi › how-to-switch-two-git-account-in-vs-code-463460640aa9
How to switch two git account in VS Code | by Abhay kanwasi | Medium
December 18, 2023 - Step 2 : Go to your directory where .git file is present or from where you pushing your code.
🌐
YouTube
youtube.com › watch
How to Change GitHub Account in VS Code (2026 Identity Switch) - YouTube
Here's how to change your GitHub account in VS Code.This tutorial walks through swapping the signed in GitHub identity inside Visual Studio Code, from signin...
Published: August 13, 2026
🌐
tutorialpedia
tutorialpedia.org › blog › i-have-2-github-accounts-how-can-i-use-both-when-i-am-working-in-vs-code
How to Use Two GitHub Accounts in VS Code: Switching Between Personal & Company Accounts — tutorialpedia.org
However, for Git commits and pushes, the SSH key and per-repo Git identity described in this guide remain the authoritative way to keep your personal and company work separate. Open VS Code. Open your personal repo: File > Open Folder > ...
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
GitHub Accounts Switcher - Visual Studio Marketplace
Extension for Visual Studio Code - Easily switch between multiple GitHub accounts in VS Code/Cursor. Manage GitHub CLI authentication, OAuth tokens, and switch between personal, work, and client accounts seamlessly.
🌐
Reddit
reddit.com › r/vscode › how do you properly use vs code with multiple github accounts and copilot?
r/vscode on Reddit: How Do You Properly Use VS Code with Multiple GitHub Accounts and Copilot?
February 3, 2026 -

Hello everyone,

I’m looking for help or guidance on working with VS Code when using multiple GitHub accounts. I currently have three GitHub accounts: One for work One for personal development One for a separate project I recently started I tried using GitHub’s Accounts / Profiles features, and also looked into combining setups, but none of these approaches really worked for me. What I’m looking for is a simple and reliable way to switch between accounts, covering both GitHub authentication and GitHub Copilot access. My main concerns are: Making sure my personal account does not use my work Copilot resources Ensuring work-related code is not sent to my personal Copilot Keeping a clean separation between contexts 🔹 Latest Attempt My latest attempt was using VS Code Profiles, and signing in to different GitHub accounts per profile. Unfortunately, switching profiles doesn’t reliably switch the GitHub account in use. I’m seeing issues like: Not Found errors when cloning via Command Palette → Git: Clone → select from GitHub Work repositories showing up in the repo list even when I’m in my personal profile A general feeling that GitHub authentication and Copilot context are leaking between profiles Because of this, I still can’t be confident that each profile is truly isolated in terms of: GitHub account Copilot usage Repository access I’ve searched online and tried ChatGPT and similar tools, but most answers were confusing, incomplete, or incorrect. If anyone has a clean setup, best practices, or real-world experience managing this properly in VS Code, I’d really appreciate your input. Thanks in advance 🙏

🌐
Reddit
reddit.com › r/git › how to switch git accounts
r/git on Reddit: How to switch Git accounts
June 15, 2025 -

How do I log out from my existing git account and log in to another one?
i tried removing my git from credential manager but still its the same account in VS code, it does not even ask me for new sign in
even if i removed my git, it just stays there in VS code, and i tried renaming the author but no didnot work

🌐
GitHub
github.com › orgs › community › discussions › 68770
How can I switch the Github account associated with Github Copilot in Visual Studio? · community · Discussion #68770 · GitHub
September 29, 2023 - It just seems to remember from somewhere my original Git account I used when I first installed it. ... There was an error while loading. Please reload this page. Something went wrong. There was an error while loading. Please reload this page. ... I also did the same thing with no prompt. I poked around and found a line in a config file with the account name but cannot edit it as it says its a system file. The file is C:\Users{user}AppData\Roaming\Code\User\globalStorage\globalState.json line is: "github-DavySprocket": "[{"id":"github.copilot","name":"GitHub Copilot","allowed":true}]",