Search code examples
gitvisual-studio-codebranchsettings

How to prevent VSCode from displaying unpublished branch lines in green text?


I accidentally published one of my branches to remote, then deleted it from remote and ran git branch --unset-upstream. Now the lines for all my unpublished branches are green, or at least I'm pretty sure they weren't green before. It's an annoying distraction, as I don't need to be constantly reminded to publish branches I don't want to publish.

I looked through all the settings and the issues in VSCode's GitHub repo, searched DuckDuckGo and StackOverflow, even asked ChatGPT (LOL), and finally resorted to Bing since it's also a Microsoft product. I can't even find a single mention of this feature anywhere, much less how to disable it.

Is there a way to make VSCode stop displaying them as green?

screenshot of branches list


Solution

  • The green color for unpublished branches is set by default in the visual studio code.

    But you can simple change the color via "workbench.colorCustomizations". Search about this and then click "Edit in settings.json".

    enter image description here

    When the settings.json-file is opened, you can add the following line

    "gitlens.decorations.branchUnpublishedForegroundColor": "#fff"
    

    in the section workbench.colorCustomizations (should automatically put the cursor focus there if you follow my steps).

    If you have added this line and saved, you will see, that the unpublished branches were displayed white (because of #fff). I have colored unpublished branches red, as you can see in my overview image:

    enter image description here