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.
how to change github accounts
How to change GitHub Account in Visual Studio Code - Stack Overflow
I have 2 GitHub accounts. How can I use both when I am working in VS Code? - Stack Overflow
How do you use different GitHub accounts in VSCode?
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.
- "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
- 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:
- Choosing "FILE" from the title-bar menu.
- Choose "CLOSE FOLDER" from the file-menu.
- 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!
- First, Click the "Account Context Menu"
- With the menu open choose the option that says "Sign-in to Sync Settings" as shown in the image below.
- 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.
- 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.
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.
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!
Configuring 2 (or multiple) GitHub accounts on VSCode. Without signing in and out everytime.
Click Profile Icon on the sidebar. Click your account on GitHub and click
Manage Trusted Extensions.
Click on the gear icon next to GitHub.

Now click on
Use new accountThis 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
Download and install the GitHub CLI from https://cli.github.com/
On your command line type the below command and login using your first account.
$ gh auth loginRepeat the above step for your second account.
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'Use the following to switch between accounts:
$ gh auth switchIf you have multiple accounts setup, specify the username, eg:
$ gh auth switch -u second_account_usernameBefore making any commits on repos on different accounts make sure
gitis using the appropriateusernameandemailto 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
Finally, you should be able to freely use multiple GitHub accounts on VSCode, or anywhere to be precise, using
gh auth switchandgit config ...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
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.
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?
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 🙏
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