最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - VSCode not showing changes in source control git panel - Stack Overflow

programmeradmin4浏览0评论

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?

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?

Share Improve this question edited Oct 20, 2019 at 10:47 George asked Oct 19, 2019 at 20:29 GeorgeGeorge 2,4223 gold badges18 silver badges39 bronze badges 5
  • 1 Hey @George, did you find an answer....got the same issue :( – Phil Hawthorn Commented Jul 25, 2020 at 19:19
  • 1 can't remember but try the refresh button (circular arrow) if it happens again. – George Commented Jul 26, 2020 at 0:31
  • Thanks, I rebooted and it went away so all good :+1 – Phil Hawthorn Commented Jul 26, 2020 at 14:30
  • sudo apt install git Solved my issue in Ubuntu 20. Thanks :) – Arjun G Commented Mar 26, 2021 at 11:00
  • I faced this same issue. This solution works for me stackoverflow.com/a/70428355/8730140 – Simran Singh Commented Dec 20, 2021 at 21:42
Add a comment  | 

5 Answers 5

Reset to default 10

Restart the extension host by Command palette -> Restart Extension Host.

Is faster than restarting/ reinstalling VSCode.

Happened to me as well. I created a file by running touch aaa.txt and then it showed all changed files. After that I have deleted the created file

Nothing worked for me. This finally worked. Go to settings -> search for auto save -> Make the option as afterDelay. And make the afterDelay seconds as low as possible. Restart vscode Git changes show up only after the file is saved. This should help.

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

I happened to face the same problem when I opened another project in VSCode. "SOURCE CONTROL: GIT" panel did not show changes in my files until I used

git add .

Below solution worked for me:

  1. go into settings (file->preferences->settings).
  2. search "Git: Post Commit Command".
  3. select 'sync' option from drop down menu.

发布评论

评论列表(0)

  1. 暂无评论