Home > Net >  Visual Studio 17.4.3 shows no git repository or branches
Visual Studio 17.4.3 shows no git repository or branches

Time:01-12

I recently encountered an error when pulling the latest git changes on a particular branch in Visual Studio 17.4.3. Unfortunately I don't remember the exact text except for "IndexOutOfBoundsException". Ever since I have been unable to get any information from that particular repository, e.g. local- and remote branches. The bottom right corner simply states "Select Repository" even though the repository is already selected:

repository selection

It also states in the top right corner that there are no local or remote branches available, even though they clearly exist:

local and remote branches

The "Manage branches" panel also shows no information about the branches available in the repository and the output from "Source Control - Git" only shows 2 lines:

Opening repositories:
C:\Git\Web-Widgets-EasyBooking

. If I run git status in a terminal from the project folder it says that my master branch is up to date:

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

It seems like the integration between Visual Studio and git is completely corrupt but only for this repository, all other repositories show the local and remote branches without any issues, that is if I start Visual Studio from an already working repository. Once I open the corrupt one then no repositories can be opened and I need to restart Visual Studio. This is what I have tried so far:

  • Restarting Visual Studio
  • Running Visual Studio as an administrator
  • Disabling the "Git line-staging support" option under "Preview Features"
  • Deleting the local repository folder (including all hidden folders) and cloning it from git
  • Adding the local repository folder to the global git config under safe.directory, with and without the %(prefix) prefix
  • Reinstalling Visual Studio

Can anyone tell me if there are other remedies I can try out?

CodePudding user response:

It looks like the issue was resolved after I upgraded to version 17.4.4 which was released yesterday. The release note at learn.microsoft.com does not mention any corrections for the git integration so I don't think it explicitly solved the issue. It may simply have been a side effect of the update but for anyone with similar issues it may be worth installing an older version of Visual Studio and upgrade afterwards.

  • Related