6

I am using Git inside Visual Studio 2013. When I attempt to do any operation against a remote like fetch, pull, push, etc. I get the following error:

An error occurred. Detailed message: An error was raised by libgit2. Category = Net (Error). A specified logon session does not exist. It may already have been terminated

I was unable to find an answer but eventually found two work-arounds. I will post the work-arounds here.

  1. I downloaded Git so I could use it outside of Visual Studio. If I ran git remote commands on the command line they worked just fine so the problem was not with git or my remote git repository.

  2. Whenever I do a remote git operation through Visual Studio it uses the standard windows dialog to capture the password. I noticed that I would always get the error if the "Remember my credentials" box was checked. If I unchecked it, it would work fine.

enter image description here

Mark Dornian
  • 318
  • 4
  • 9
  • You found the best solution. Use git directly and skip the Visual Studio extension which is not so good. – Michael Welch Feb 06 '15 at 01:03
  • It seems that there is a bug in Visual Studio with regard to storing your credentials. I always prefer the Git command line for basic workflow operations (merge, rebase) and rely on a plugin only when I want a visual. – Tim Biegeleisen Feb 06 '15 at 01:16
  • Try opening the Windows Credential Manager and look up the repository. Delete the stale account details. – jessehouwing Feb 06 '15 at 04:59
  • There is nothing saved in the Windows Credential Manager – Mark Dornian Feb 10 '15 at 18:53
  • 2
    Nice find. Unchecking the _Remember my credentials_ checkbox fixes the problem for me. Thanks for saving me a few hours of searching. – David Tansey Feb 24 '15 at 18:17

2 Answers2

6

Unchecked "Remember My Credentials" checkbox.

Visual Stdio 2015 asked me enter credentials two times.

please uncheck above mentioned checkbox both the times. it worked for me

Suhas Dhongade
  • 79
  • 2
  • 12
0

Ran into this issue as well on VS 2015.

  • Make sure that your repository location is correct in your Global Settings (this also would probably apply to Repository Settings, if you're in a situation where you're switching credentials).
  • Your Windows Credential Manager may have stale credentials. See this question to resolve that issue.
Community
  • 1
  • 1
codo-sapien
  • 833
  • 3
  • 14
  • 24