VSCode not showing changes in source control git panel

若如初见. 提交于 2021-02-20 10:12:38

问题


When I make a change to a file in the project folder, the 'SOURCE CONTROL: GIT' panel is not showing the changes unless I type git add . in the terminal.

They do show as 'Uncommitted Changes' in Git Graph.

You can see this in the below screenshot:

I have quit VSCode and reopened it, and made sure to open the project root folder which has the .git file which when opened showed the changes, but after I had committed, pushed, and then made some new changes, they were again not picked up.

How can I resolve this for good?


回答1:


This happened to me when I tried merging one branch into another with merge conflicts.

The problem ended up being two sets of duplicate files in git Unmerged paths where the only difference was a folder name in their paths with different letter casing. I used git remove on the two files with incorrect casing and the problem was immediately resolved.

Example Resolution

% git status

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)

    both deleted:   filePATH/file01.ts
    both deleted:   filePATH/file02.ts
    added by us:    filePath/file01.ts
    added by us:    filePath/file02.ts

% git remove filePATH/file01.ts
% git remove filePATH/file02.ts
% git add filePath/file01.ts
% git add filePath/file02.ts


来源:https://stackoverflow.com/questions/58467720/vscode-not-showing-changes-in-source-control-git-panel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!