Can i make Visual Studio Code highlight staged changes?

Not natively (VS Code) or with GitLens (GitHub repo)

As you probably know (or written), there is a feature request

Right now, I know which lines are not staged (green for new, blue for edited) and maybe when I commit locally, highlight those lines in a different color (purple?) to represent “committed but unpublished.”

But for now, you need to switch to the version control part of VSCode to see what is about to be committed:

uncommitted but staged

There you can inspect staged changes to be committed.

Note: there is an uncommittedColor, but I don’t know if it references staged or unstaged changes, or how it is used.
GitLens 6.2 does mention gitlens.gutterUncommittedForegroundColor themable color, but I don’t see it anymore in my current 8.3 GitLens version.


The Microsoft/vscode 60389 opened by the OP includes for now:

When you’re editing a file in Git, there are three versions of it:

  • HEAD
  • Index
  • Working tree

So, there are two possible diffs to show:

  • HEAD <> Index
  • Index <> Working Tree

We currently show gutter decorations for Index <> Working Tree.
Since the file which is open in the editor is always Working Tree, it doesn’t make any sense to show HEAD <> Index changes in the gutter, since none of those two files is Working Tree.


Aug. 202&: Lefty adds in the comments:

In recent GitLens version its possible to temporarily enable this highlighting by pressing Ctrl+Shift+P and entering gitlens.toggleFileChanges.

It disappears on first edit though :(.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)