You can add your public GitHub account at first launch or later, without needing to sign into Visual Studio with a Microsoft account, work account, or school account. You can add multiple GitHub accounts to the IDE. The first account added becomes the active account, but you can switch the active account to another one at any time. Adding multiple GitHub accounts impacts Copilot, and version control scenarios, as well as general GitHub authentication experiences across Visual Studio.
If you choose to not sign in with GitHub at first launch, you can add your GitHub account later using the profile card or the Account Settings dialog as follows.
Then, follow these instructions to add your GitHub account.
Select the icon with your profile name in the upper-right corner of the Visual Studio environment, select GitHub if you haven't already signed in or Add another account, and then select GitHub.
You'll be redirected to the browser, where you can sign in with your GitHub credentials. After you sign in, you'll get a success window in the browser, and you can return to Visual Studio.
The GitHub account you added will now be present in your profile card. Note that the account you signed in with first is the Active account.
Add a GitHub account from the Account settings dialog
Open the Account Settings dialog by going to File > Account Settings....
From the All Accounts submenu, select + Add to add an account, and select GitHub.
You'll be redirected to the browser, where you can sign in with your GitHub credentials. After you sign in, you'll get a success window in the browser, and you can return to Visual Studio.
Your GitHub account will now be present in the All Accounts submenu.
Open the Account Settings dialog by going to File > Account Settings....
From the All Accounts submenu, select + Add to add an account, and then select GitHub.
You'll be redirected to the browser, where you can sign in with your GitHub credentials. After you sign in, you'll get a success window in the browser, and you can return to Visual Studio.
Your GitHub account will now be present in the All Accounts submenu. This account becomes the Active account.
Switch the active account
You can switch the active account to another signed-in GitHub account from the profile card or the Account Settings dialog.
Switch using profile card
Select the Sign in link in the upper-right corner of the IDE, select ... for the account you want to make the new active account, then select Set as active account.
Switch using Account Settings
Open Account options by clicking ... for the account you want to make the new active account, then select Set as active account.
Enable GitHub enterprise accounts
By default, Visual Studio only has public GitHub accounts enabled. Use the following steps to add a GitHub Enterprise Server account or an account associated with .ghe.com endpoints.
To enable GitHub enterprise accounts, go to Tools > Options and search for the Accounts options.
Then, check the box to Include GitHub Enterprise Server accounts. The next time you go to your Account Settings and try to add a GitHub account, you'll see options for both GitHub and GitHub Enterprise.
After you enter your GitHub Enterprise server address, select Sign in with your browser. There, you can sign in using your GitHub Enterprise credentials.
To enable GitHub enterprise accounts, go to Tools > Options > More Accounts.
Then, check the box to Include GitHub Enterprise Cloud and GitHub Enterprise Server accounts. The next time you go to your Account Settings and try to add a GitHub account, you'll see options for both GitHub and GitHub Enterprise.
After you enter your GitHub Enterprise URL, select Sign in with your browser. There, you can sign in using your GitHub Enterprise credentials.
Select the icon with your initials in the upper-right corner of the Visual Studio environment. Then, select Add another account > GitHub.
You'll be redirected to the browser, where you can sign in with your GitHub EMU credentials.
Manage accounts using the Account Settings dialog
Select the icon with your initials in the upper-right corner of the Visual Studio environment. Open the Account Settings dialog by selecting Account settings or by going to File > Account Settings....
From the All Accounts submenu, select + Add dropdown to add an account, and then select GitHub.
Select GitHub Enterprise on the Connect to GitHub dialog.
Select the icon with your initials in the upper-right corner of the Visual Studio environment. Open the Account Settings dialog by selecting Account settings or by going to File > Account Settings....
From the All Accounts submenu, select + Add dropdown to add an account, and then select GitHub.
Select GitHub Enterprise on the Connect to GitHub dialog.
Note
Ensure you enter your GitHub EMU account credentials (the username has an underscore followed by the company name) on this page.
After you sign in, you'll get a success window in the browser, and you can return to Visual Studio.
Remove an account
To remove an account, select Remove for the account you want to remove from the All Accounts submenu in the Account Settings dialog.
Select File > Account Settings....
All Accounts lists all accounts signed into Visual Studio. Select Remove for the account you want to remove.
Confirm the removal on the dialog that appears.
To remove an account:
Select the icon with your profile name in the upper-right corner of your Visual Studio environment.
Select Remove account for the account you want to remove.
You can also use the Account Settings dialog to remove an account.
Select File > Account Settings....
All Accounts lists all accounts signed into Visual Studio. Select Remove for the account you want to remove.
Confirm the removal on the dialog that appears.
Troubleshooting sign in issues
If you're experiencing issues when adding or re-authenticating GitHub accounts, try the following steps:
HTTP Strict Transport Security (HSTS) issues
Verify that HTTP Strict Transport Security (HSTS) is not enabled for localhost on your system's default web browser:
On Microsoft Edge, you can type: edge://net-internals/#hsts and enter localhost under the Delete domain security policies section.
On Google Chrome, type: chrome://net-internals/#hsts and enter localhost under the Delete domain security policies section.
Run-as issues
Running Visual Studio using an account that doesn't match your signed-in Windows account, may cause issues when adding GitHub accounts to Visual Studio. You may encounter this issue when using 3rd party products that attempt to run Visual Studio elevated.
You can verify the user by following these steps:
Open the Task Manager
Navigate to the Details tab
Search for the devenv.exe process
Ensure the username for that process matches the signed in Windows Account
To fix this, run Visual Studio as the user you're signed into Windows with, and then add your GitHub account.
Note
Please report a problem if you're still experiencing sign in issues.
Hands-on module focused on getting the learner comfortable with basic source control commands through an integrated development environment or web portal.