Work with GitHub accounts in Visual Studio
If you have a public GitHub or GitHub Enterprise account, you can add it to your Visual Studio keychain. After you add your account, you'll be able to take advantage of the platform integration by accessing and creating GitHub repositories, right from Visual Studio.
Adding public GitHub accounts
You can add your public GitHub account if you're already signed in to Visual Studio with a Microsoft account, or a work or school account.
Select the icon with your initials in the upper-right corner of the Visual Studio environment. Then, select Account settings... to manage your accounts. You can also open the Account Settings dialog by going to File > Account Settings.
Under the All Accounts submenu, select the plus sign 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.
You'll have both accounts present in your All Accounts submenu.
If you're not already signed in to Visual Studio with a different account,select the Sign in link in the upper-right corner of the Visual Studio environment. You can also open the Account Settings dialog by going to File > Account Settings. Then, follow the instructions above to add your GitHub account.
Adding GitHub enterprise accounts
By default, Visual Studio only has public GitHub accounts enabled.
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.