You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode中Git冲突文本显示红色的问题解决及是否需更换扩展的咨询

Fixing Git Conflict Text Highlight Color Issue in VS Code

Hey there! I’ve run into similar syntax highlighting quirks in VS Code before, so let’s walk through how to get your Git conflict text back to the blue you’re used to, and figure out if you need to swap any extensions.

1. Check Your Theme’s Git Conflict Decorations

First off, theme updates or accidental theme switches are the most common culprit here. Here’s how to adjust it:

  • Open VS Code settings with Ctrl+, (Windows/Linux) or Cmd+, (Mac)
  • Search for git conflict decorations in the settings search bar
  • You’ll see options for current (your branch’s code), incoming (the conflicting branch’s code), and common (the base code) sections of conflicts. Click the color picker next to the one showing red, and set it back to your preferred blue (like #0066cc for a soft, readable shade)

If you’ve tweaked settings before and can’t remember what changed, resetting the config might help:

  • Open the Command Palette with Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
  • Type Preferences: Open Settings (JSON) and hit enter
  • Look for any lines starting with "git.conflictDecorations" — delete those custom entries, save the file, and restart VS Code. This will revert to your theme’s default conflict colors.

3. Troubleshoot Third-Party Git Extensions

VS Code’s core Git features handle conflict highlighting, but third-party extensions like GitLens or Git Graph can sometimes override these settings:

  • Go to the Extensions panel (Ctrl+Shift+X / Cmd+Shift+X), find all Git-related extensions you have installed, and disable them all
  • Restart VS Code and check if the conflict color is back to blue
  • If it is, re-enable extensions one by one until you find the one causing the issue. You can either update that extension to the latest version (bugs get fixed all the time!) or replace it with an alternative if the problem persists.

4. Reinstall VS Code (Last Resort)

If none of the above works, there might be a corrupted file in your VS Code installation:

  • Back up your settings and extensions (you can sync them via VS Code’s built-in sync feature if you’re signed in)
  • Uninstall VS Code completely, then delete the residual config folders:
    • Windows: %APPDATA%\Code
    • Mac: ~/Library/Application Support/Code
    • Linux: ~/.config/Code
  • Download and install the latest version of VS Code

Do You Need to Replace Extensions?

In most cases, no — you won’t need to swap extensions unless you’ve confirmed a specific extension is causing the conflict color bug. Start with adjusting theme settings and resetting configs first; those fixes are quick and usually resolve the issue.

内容的提问来源于stack exchange,提问作者ludenparis

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.27 18:52:32