VSCode在源代码管理git面板中未显示更改 [英] VSCode not showing changes in source control git panel

查看:945
本文介绍了VSCode在源代码管理git面板中未显示更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我对项目文件夹中的文件进行更改时,除非在终端中键入 git add.,否则"SOURCE CONTROL:GIT"面板不会显示更改.

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.

它们在Git图中确实显示为未提交的更改".

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

您可以在下面的屏幕截图中看到它:

You can see this in the below screenshot:

我已经退出VSCode并重新打开它,并确保打开了项目根文件夹,该文件夹具有.git文件,该文件在打开时显示了更改,但是在我提交,推送然后进行了一些新更改之后,它们再次没有捡起.

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?

推荐答案

当我尝试通过合并冲突将一个分支合并到另一个分支时,这发生在我身上.

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

问题最终是git Unmerged path 中的两组重复文件,其中唯一的区别是它们路径中的文件夹名称带有不同的字母大小写.我对两个文件的大小写不正确使用了 git remove ,该问题立即得到解决.

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.

% 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

这篇关于VSCode在源代码管理git面板中未显示更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆