Search code examples
gitvisual-studio-codebranchgit-branchgit-remote

Quickly find out which Git remote is being tracked in VS Code?


I often use two Git remotes--both with their own master branches--with some of my projects.

Bad practice aside, is there a way to quickly identify which <remote>/master is currently being tracked by local checked-out branch in VS Code?

I'm looking for a better visual cue, ideally something that displays this information in the status bar or in the Source Control pane.

source_control_vscode

Currently, I either need to perform a git branch -avv from the command line, or I need to look at GitLens or Git Graph to reveal this information.

Any ideas? Thanks!


Solution

  • GitLens has a Show Repository Status command which will tell you is your are ahead/behind of the remote/branch currently being tracked by the checked out branch:

    https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/docs/menu-repo-status.png

    Here the current remote is origin, and the branch is tracking the origin/demo branch.