29

Working with VS Code, the explorer git status gutter indicators stopped showing for one of my repositories.

  • I tried rebooting VS Code, My PC
  • I tried removing the index file and git reset

Those didn't resolve the issue.

(Git changes are still tracked in the Source Control Manager panel)

1
  • historical note: there was a specific, rather high-visibility bug in VS Code 1.76.1 that broke SCM diff decorations: stackoverflow.com/q/75715788/11107541 Commented Aug 13, 2023 at 22:51

11 Answers 11

44

Apparently another common reason for this is that you are accessing your git repo through a symlink. See: https://github.com/microsoft/vscode/issues/60010#issuecomment-433424527

This was the case for me and redirecting vscode to open the folder via the full path fixed it.

Sign up to request clarification or add additional context in comments.

Comments

28

This started happening to me when opening subdirectories from a monorepo.

I had to to set the "Open Repository In Parent Folders" setting to "always" to make it work.

enter image description here

Or in json:

"git.openRepositoryInParentFolders": "always"

Not sure when this option has appeared or default changed because the git gutter used to work without this setting.

3 Comments

Thank you, I ran into this as well! Setting this solved the issue for me. I guess there was a behavior change in some recent version of VS Code?
Ty! This is exactly what happened to me.
6

It took me a long while to figure this one out. My changes were still being seen by VSCode and Gitlens, but they were not being tracked in the gutters... for SOME files. Uninstalling VSCode and re-installing would allow tracking for a bit, but even with all extensions off, it would eventually stop tracking in the gutter.

My solution:

I had renamed a few folders by changing the case. Git was not set to track case-sensitive, my Mac was viewing them as the same file, and VSCode was just being VSCode... Going back and renaming the files through Git ended up fixing the issue:

git mv navigation tmp
git mv tmp Navigation

successfully updated it. If it isn't working, I also had to updated git global (temporarily) and pushed with:

git config --global core.ignoreCase false

1 Comment

This saved my day! I have a nx monorepo and istg Idk since when the gutter indicators were gone for some of the capitalized files. This is so random and hard to figure out. Idk how you figure this out, but kudos and many thanks for sharing!
3

Solution for me has been to delete my folder (after saving/pushing it on the remote) and cloning the repo again.

3 Comments

For me restarting the computer did the trick. Interestingly enough the git gutter wouldn't show in one project but did show in other projects. That seems specifically weird. In any case: After the restart it works in all projects again.
I am facing the same issue but strangely enough, none of the above solutions worked for me.
This solution works for me. While restarting the PC does not work.
3

It may also be Git Staged changes. Those don't have gutter indicators shown by design apparently.

As of 2024-05-16, it's VS Code version 1.89.1.


When I have staged or commited changes that have not yet been pushed to the remote, or when they have been pushed but a pull request has not yet been opened, all my gutter indicators disappear.

Source


Example "Staged"

enter image description here

enter image description here

Example "Unstaged"

enter image description here

enter image description here

Comments

2

In my case, the gutter doesn't show if the folder path contains a ., like /home/user.focus/folder

Change the path to one without . works for me.

2 Comments

for me my folder had a work-space changing it one word fixed it for me
Thank you, this was it. A dot in the folder path! Unfixed years later, this bug is yet another example of sloppy engineering that would take a couple hours to fix in a path matcher in order to save countless hours of other peoples' time.
2

In my case gutters disappeared from flutter repository. I think it happened after I upgraded flutter to 3.7.7.

I created a simple repository with one .txt file and ensured that gutters not working there as well.

At the same time I observed that gutters worked normally in c++ repo.

So I tried to rename one .dart file in flutter repo to .cpp. Then I renamed it back to .dart and gutters appeared again.

Hopefully it helps.

Comments

1

I have encountered this issue and found out that deleting my workspace file and then creating it anew has resolved the problem.

I have found out this was only happening in one workspace and not the others. Something in my workspace file must have gotten messed up somehow. When I opened another workspace, the gutter icon highlighting worked fine, but then when I went back to the problematic workspace it was still not showing up.

Comments

1

In my case, i needed to define gpg.format value to ssh in the .gitconfig file located in the ~/ or /user/ folder (MacOS, not sure for Windows). Source of inspiration from this answer

For some reason, it had no value, but after i saw in the Output part of VS code console, i saw that it was missing value:

error: invalid value for 'gpg.format': ''

Previous state:

[gpg]
    format = 
    program = gpg

Solution:

[gpg]
    format = ssh
    program = gpg

Comments

0

My problem was that i recently installed an extension for solidity, and this extension made the problem i uninstalled, restarted vscode and everything went back to normal.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
0

This issue may be related to an Xcode license problem on macOS.

If you're trying to stage a file using the Git integration in VSCode, you might see an error message prompting you to agree to the Xcode license.

To resolve this, run the following command in your terminal to accept the license:

sudo xcodebuild -license

Alternatively, you can try running a Git command in the terminal, like sudo git status. This will also prompt you to accept the Xcode license agreement.

For more information, see:

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.