Reputation: 4770
I'm trying to use the Git client inside Visual Studio Code. I have my Git repository on Team Services. In the Team Services site, I've created a "personal access token". When I try to pull from inside my Visual Studio Code I get the following screen.
Can I use my access token in this dialog? I've tried different usernames, but authentication always fails.
Upvotes: 1
Views: 10336
Reputation: 8516
This topic or links from this topic might help: Use Git Credential Managers to Authenticate to Visual Studio Team Services
It looks like there's also an Visual Studio Team Services extension for Visual Studio Code now that handles credential storage.
Upvotes: 0
Reputation: 29968
I would recommend you to use Git Credential Manager. With this tool installed, you will get a "Sign in" dialog for Visual Studio Online when you pull from Visual Studio Code. You can simply enter your Visual Studio credentials in the dialog to sign in and the tool will manage the Git credentials automatically.
Upvotes: 1
Reputation: 142054
This article describe in details how to do it.
When you create the token, you see a token (only visible after creation !) that you should copy and keep safe.
This token alone is sufficient to authenticate against VSO. So when you now clone a Git repository you only have to fill in this token in the password box. Username can be empty or any value
The great thing is that you can revoke rights or the token afterwards and make sure that people cannot access stuff anymore
Upvotes: 5