Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple GitHub account support #127967

Closed
Xaroth opened this issue Jul 4, 2021 · 93 comments
Closed

Multiple GitHub account support #127967

Xaroth opened this issue Jul 4, 2021 · 93 comments
Assignees
Labels
feature-request Request for new features or functionality github-authentication Issues with the GitHub Authentication extension on-release-notes Issue/pull request mentioned in release notes on-testplan

Comments

@Xaroth
Copy link

Xaroth commented Jul 4, 2021

Many of us have dedicated accounts for work and non-work tasks. However, VSCode's GitHub authentication does not seem to support more than one GitHub account.

There are currently two ways of dealing with this;

As mentioned in #71253, one can use git config settings for separate accounts. This is a bothersome approach, and in some cases requires extra steps for every repository you are trying to access.

Alternatively, one can sign out, and sign in on the other account every time one changes between working on work-code, and non-work code. Again, this is a bothersome approach, and prone to frustration as you have to check which account you've signed in to.

Would it be possible for VSCode to support multiple GitHub accounts, so that it can ask you which credentials you want to use per repository?

@vscodebot
Copy link

vscodebot bot commented Jul 4, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@JB-Scott
Copy link

JB-Scott commented Aug 15, 2021

This would be extremely helpful. Maybe you could list the GitHub account you want to use in a configuration file that is in the project folder. Or multiple GitHub accounts could be listed in the 'Account' context menu and you could select which one to use.

@ameeno
Copy link

ameeno commented Feb 9, 2022

Need this :(

@okikio
Copy link

okikio commented Mar 23, 2022

Is this in the works?

@TylerLeonhardt
Copy link
Member

The biggest problem here is that GitHub doesn't have a way to be logged in to multiple accounts. You are automatically logged in with whatever account you're logged into in your browser and that makes it tough to do this feature in VS Code.

@Juan321654
Copy link

what about some kind of script to switch accounts, which saves your info somewhere, and then just have in VScode a "switch account" button and it would automatically do it for you instead of manually logging out and in, kind of what Gmail has.

@kenberkeley
Copy link

kenberkeley commented Jun 9, 2022

Temp solution: download and install "VS Code Insiders" (so you will have 2 VS Code installed).

@skupjoe
Copy link

skupjoe commented Jul 31, 2022

Hi, I use Settings Sync/GitHub Copilot extensions on 1 gh account and the GitHub Pull Requests extension with another (work) gh account, and I am running into trouble. I can only use one combination or the other.

Please support this thank you!

@rob-derosa
Copy link
Member

Hi there, Rob from GitHub here. Our friends at Expedia are struggling with the lack of multi-account support within VS Code. Happy to provide more context around their use case if that's helpful. 🙏🏻

@TylerLeonhardt
Copy link
Member

@rob-derosa we need work on the GitHub side for us to support this. Mainly, we need a way for someone to choose the account they want to use to log in with on the authorize API.

@Cerdtruir
Copy link

I was able to sign into 2 github accounts on vscode for copilot.

  1. Sign out of all accounts
  2. Make sure copilot is active
  3. Restart vscode and wait for the copilot sign in popup and sign in to your copilot account after clicking it.
  4. Then sign in normally to your main account from the settings sync button

@SDCalvo
Copy link

SDCalvo commented Dec 13, 2022

I NEED this feature, would love to be able to have a context menu with all my github accounts and a fast and easy way to switch between them.

EDIT: typo

@StewartRyanSony
Copy link

At my company we use on-prem GitHub Enterprise. I need to stay signed into it obviously for my work.
If I sign out of my GitHub.com account leaving my GitHub Enterprise account as the only logged in account, VSCode continues to bug me that I need to be signed in to GitHub.com for things to work correctly.

VS Code Needs to Support multiple GitHub Accounts.

@Juan321654
Copy link

I found a workaround... use your terminal with one account, then download the GitHub desktop version, and you can use another account with that one. been using the terminal for my personal use, and the GitHub desktop for my job.

@rob-derosa
Copy link
Member

I've also heard you can use SSH for one account and a PAT for the other.

@TylerLeonhardt
Copy link
Member

@StewartRyanSony what feature/extension is bugging you to sign in to GitHub.com?

@StewartRyanSony
Copy link

StewartRyanSony commented Dec 19, 2022

@TylerLeonhardt,
The extension GitHub Pull Requests and Issues
image

@okerx
Copy link

okerx commented Jul 8, 2024

The new vscode Profiles feature is pretty awesome, I wonder if it's possible to link a github account to each vscode profile instead of multiple github accounts in general, that would make more sense and make it easier to switch between personal/work profiles

https://code.visualstudio.com/docs/editor/profiles

@huyz
Copy link

huyz commented Jul 8, 2024

I wonder if it's possible to link a github account to each vscode profile instead of multiple github accounts in general, that would make more sense and make it easier to switch between personal/work profiles

Wouldn't work for me. I have a paid subscription to Copilot on one account. Why wouldn't I want that to work for all my profiles, regardless of which GitHub account I'm logged into, e.g. to manage PRs?

@Dustin-Chromedome
Copy link

ouch, still open. bummer

@senkenn
Copy link

senkenn commented Jul 26, 2024

It worked in code-insider when I enabled it in the settings! Thank you very much!

@z-budhirajamadhav
Copy link

z-budhirajamadhav commented Jul 26, 2024 via email

@BlackDahlia313
Copy link

https://media2.giphy.com/media/v1.Y2lkPTc5MGI3NjExeTRxN2F6d2tlMW00cG0zOHZyOXE2MnRzejI5cTZobW03MGI2MWs1ciZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/8JrcyXvpOaFbFIatkm/giphy.webp

^ us from asking to receiving.

But seriously. THIS IS AMAZING!!!!

@TylerLeonhardt
Copy link
Member

It's true, there is very very experimental support of multi-accounts for GitHub in VS Code. However, it's not quite ready for prime time as:

  1. there are a few 1st party extensions that don't yet play nice with this multi-account support
  2. and 3rd party does not yet have an API for "getting all GitHub accounts" yet (it's proposed API that should be finalized soon)

but we are making progress. So, while you can try it out, just know things may not work as you expect just yet.

It's a long time coming, that's for sure and what a journey it has been to get here. (it's not been easy, otherwise we'd have had it sooner, I assure you!)

@alekdavis
Copy link

I have a work and personal accounts. I am trying to push code to a public repo, VSCode asks me which account I want to use (gives me an option of picking between work and personal), I select my personal account, push, but when I go to the GitHub repo, the check in is done by my work account (which is my default global). Am I doing something wrong?

@vedrk5672
Copy link

It should be same as switching profiles in chrome, unable to understand why profiles shares the extension data. profiles are created for this kinda reasons only, its been too long for this issue, I don't know whether Microsoft gonna take a look into this or not but sure worth a go

@TylerLeonhardt
Copy link
Member

Today, Multi-Account is turned on by default for VS Code Insiders users. Additionally, you should now see a new option in a few places:

  • Manage Trusted Extensions:
    image
  • Extension gear (both in the Extensions view and also on the Extension's page itself):
    image

This lets you choose which account you want to use with this extension:
image

Please let me know how it goes.

@TylerLeonhardt
Copy link
Member

I closed this issue as the work is done.

Since I didn't get a tonnnn of time to test this, I'm gonna defer turning this on by default for the Stable release next week.

Here's the follow up issue to track that enablement:
#229421

But once 1.94 drops, you can apply this setting:

"github.experimental.multipleAccounts": true

@TylerLeonhardt TylerLeonhardt added the on-release-notes Issue/pull request mentioned in release notes label Sep 27, 2024
@shinebayar-g
Copy link

I closed this issue as the work is done.

Since I didn't get a tonnnn of time to test this, I'm gonna defer turning this on by default for the Stable release next week.

Here's the follow up issue to track that enablement: #229421

But once 1.94 drops, you can apply this setting:

"github.experimental.multipleAccounts": true

How do I log in to the second account? Even after enabling the setting, I couldn't figure out how to actually log in to the second account.

@TylerLeonhardt
Copy link
Member

With tomorrow's Insiders build (this PR), Multiple GitHub account will be enabled by default.

In order to log in to a second account you either need to:

@muchisx
Copy link

muchisx commented Oct 18, 2024

Hi, @TylerLeonhardt ! Thanks for this!

When can we expect this to be available outside of the Insiders version ? even if it requires turning on a experimental feature flag. I'm keen to try it out, but I don't use the Insiders version

@gowerc
Copy link

gowerc commented Oct 20, 2024

Hi, @TylerLeonhardt ! Thanks for this!

When can we expect this to be available outside of the Insiders version ? even if it requires turning on a experimental feature flag. I'm keen to try it out, but I don't use the Insiders version

The feature is available in the current main release version you just need to set:

"github.experimental.multipleAccounts": true

His last message was just saying that this setting will default to true instead of false in the next release of insiders

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Oct 20, 2024

Tacking on to ^^ next stable release is in 2 weeks which will have this changed default. (with the setting removed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality github-authentication Issues with the GitHub Authentication extension on-release-notes Issue/pull request mentioned in release notes on-testplan
Projects
None yet
Development

No branches or pull requests