11

Visual Studio 2022 not showing any change of file in git changes window, although there are some files updates are available. Whereas GIT GUI is showing all the changes in the repository.

Once I open the repository in GIT GUI all changes are also begin to display in Visual Studio git changes window.

Shyam Narayan
  • 1,009
  • 2
  • 14
  • 28
  • Have the same problem... making changes, but suddenly it's like there was an auto-commit and a push. – Keith Bluestone Nov 30 '21 at 12:51
  • Same issue here with VS 2022 17.2.1. Solution was installing latest Git Bash. And adding back exception directory for the unsafe repository. `git config --global --add safe.directory C:/xxx/xxxx` – Thiam Hooi May 23 '22 at 04:35
  • 1
    Same problem in VS2019 (I have already updated git to the latest version). – Jiang Dec 20 '22 at 02:07

5 Answers5

9

visual studio 2022 shows "error parsing the git status output.". It is maybe because of mismatched versions of git or visual studio.

as a workaround, in "Package Manager Console" you can run this command:

git status

after that, visual studio shows your changes, and you can commit them!

user3770256
  • 121
  • 3
3

I ran into the same issue. Then I found the answer under this video. Try this:

git config --global --add safe.directory C:/Path/To/Repo

Notice the forward slashes.

1

I used to connect not as admin. Then in Git Repository Settings no remotes were displayed and at Git Changes there were only "create new" options.

Then I connected as admin and remotes become available, all were working as usual. Makes no sense to me but it's "working".

Saulius
  • 1,736
  • 20
  • 29
0

It might be an issue with the git index lock. This solved my problem, deleting the index lock file: Visual Studio: Git Team Explorer does not show any changes

Keith Bluestone
  • 166
  • 2
  • 9
  • Deleting index lock file does not resolve my problem, after deleting index lock file it showing all files removed from repository rather than changes. – Shyam Narayan Dec 03 '21 at 05:22
0

TL'DR

Make sure both git and vs are up-to-date + use git status and if you got a fatal: detected dubious ownership error, then run git config --global --add safe.directory '*' and restart VS, finally, if none of these works and your local and remote copies are synced: delete the local copy and re-clone the repo again!


Possible Causes:

  1. Git, VS Versions' mismatch: I have VS2022 up-to-date, but git-bash -> git --version was 7-versions old, so I have used git-bash -> git update-git-for-windows command to have an up-to-date version of git (you can download the 'git.exe' installer as an alternative). This shows git information in vs statusbar, but some solutions still not showing the git information! if this not works for you, try the next step..

  2. In Visual Studio: View -> Other windows -> Package Manager Console, then type git status. In my case, it gives me a security fatal error!

    git : fatal: detected dubious ownership in repository at 'path-to-solution'
    At line:1 char:1
    + git status
    .
    .
    

    To overcome this, I have used the following command to get rid of this issue forever: git config --global --add safe.directory '*'

  3. If the project is relatively old, try re-cloning it again (if local and remote are synced, if not: delete the .git folder, clone the repo to a new folder, copy the .git folder from there and paste it in root folder, add and commit your changes).

Muhammad Sulaiman
  • 2,399
  • 4
  • 14
  • 28