Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 8

Visual Studio asks me to sign in every time I push or sync

I'm using Visual Studio Enterprise 2017 on Windows 7 Pro 64-bit, and have Git version 2.17.1.2 installed.

 

I have two problems using this setup, and was hoping someone can help...

 

1) I have a project hosted in GitHub, and ahve connected VS to it, so I can commit changes. However, every time I close VS, it seems to forget that it was connected to gitHub. Next time I open the project, it shows it as not being under source control.

If I click the "Add to source control" button on the VS status bar (bottom-right of the window), it shows Git as an option, and if I choose that, it reconnects correctly. Anyone know why I need ot do this? I'm used to working with SVN, and I never have to do this, VS always knows it's under source control.

 

2) Probably conencted to the above, whenever I want to commit code, it asks me to sign in to GitHub, following which I get an email telling me "A personal access token has been added to your account"

Even more annoying is that once I've logged in and committed, if I do another commit later (same VS session), it asks me to log in again and sends me another email.

Anyone know why it does this? Why doesn't it remember my log-in details?

 

Thanks for any help.

7 Replies
Pilot Lvl 1
Message 2 of 8

Re: Visual Studio asks me to sign in every time I push or sync

Quick question for clarification... which plugin are you using? and are you using GitHub.com or GitHub Enterprise?

Copilot Lvl 2
Message 3 of 8

Re: Visual Studio asks me to sign in every time I push or sync

Not using a plugin, I'm accessing GitHub via Team Explorer. This was the only way I could work out how to get VS to talk to GitHub.

And it's the plain GitHub, not enterprise.

Thanks for the response.

Pilot Lvl 1
Message 4 of 8

Re: Visual Studio asks me to sign in every time I push or sync

You may also want to take a look at the last section of this page - https://github.com/github/VisualStudio/blob/master/docs/getting-started/authenticating-to-github.md#...

which describes how to create and use a Personal Access Token manually - 

What happens when you commit and push from the command line?

 

Copilot Lvl 2
Message 5 of 8

Re: Visual Studio asks me to sign in every time I push or sync

Thanks for the link. I've never used the command line, I do everything via VS, and would like to keep it that way if I can.

Can I use a personal access token from VS?

Thanks again

Pilot Lvl 1
Message 6 of 8

Re: Visual Studio asks me to sign in every time I push or sync

I believe you can use the personal access token in place of the password field - I found an old issue on GitHub relating to Visual Studio Professional which appears to be related - which is a Visual Studio bug (now showing as fixed) - it is definitely worth a try.. 

https://github.com/github/VisualStudio/issues/1474

It is also suggested as an "option" here

https://github.com/github/VisualStudio/blob/master/docs/getting-started/authenticating-to-github.md

Let me know if you have any luck

 

Copilot Lvl 2
Message 7 of 8

Re: Visual Studio asks me to sign in every time I push or sync

Thanks for the reply. Unfortunately neither of those links helped.

The first one seemed to be about why he was being asked for a token instead of a password. UNless I misread it, he wasn't asking why he was asked at all, which is my question. I just want VS to remember my credentials (like SVN does), so I don't have to sign in each time I want to commit.

The second link looked more promising, but didn't match what I see in VS. When I look at Team Explorer and click Manage Conenctions, all I see are my three GitHub repositories. I don't ahve anything that allows me to connnect to GitHub or sign in. I poked around in all the nooks and crannies in that window, but there's nothing there like that...

 

TeamExplorer.png

You can see it only shows my repos, and if I click Manage Connections, I only have the option to connect to another project.

 

Thanks again for the help. Any other ideas?

Pilot Lvl 1
Message 8 of 8

Re: Visual Studio asks me to sign in every time I push or sync

Digging around I see many similar problems with Visual Studio for Mac - that have been reported as fixed - I'm guessing you have done a similar trawl of the forums :-(

 

Aside from the standard "turn it off and on again" recommendation (basically uninstalling and re-installing) my only suggestion would be to take a look at this

 

https://github.com/Microsoft/Git-Credential-Manager-for-Windows 

and 

https://github.com/Microsoft/Git-Credential-Manager-for-Windows/blob/master/Docs/Faq.md

 

It would be interesting to see if git, when used from the command line, behaves the same way. 

 

I also found this article https://agilewarrior.wordpress.com/2017/09/25/how-to-setup-git-credential-store-in-windows/ which may prove useful.

 

Are you using credentials manager? is TFS plugged into corporate Active Directory?