Just curious what the official workflow for this is. I haven’t found a smooth and easy way to retrieve a specific remote branch using the VS Code UI. I can do it from the command line, of course, but it seems like there’s no way to do this using the VS Code UI.
For instance, if I haven’t yet checked a remote branch onto my local, it simply doesn’t appear in VS Code no matter how many times I pull or fetch.
Can anyone point me in the right direction here?
2
Answers
In the branches section of the Source Control tab, click the "Switch to Another Branch" button:
After doing that, a drop down should appear with your local and remote branches for you to switch to:
You can checkout a remote branch and automatically create a local, remote-tracking branch for it by using the
Git: Checkout To...
command in the command palette. It will open a menu first prompting you to select a repository if your workspace has multiple repositories, and then prompt you to select a branch to check out (remote branches will be shown in a dedicated sectio).You can checkout a remote branch without creating a local, remote-tracking branch by using the
Git: Checkout To (Detached)...
command in the command palette. There’s also a status bar indicator of the current branch that you can click to open up the same menu.Of course, you’ll need to
git fetch
to update your local repository’s knowledge of what remote branches exist and what commit they point to. (VS Code has a correspondingGit: Fetch
command you can use the command palette).I have never heard of this terminology. I assume you mean you haven’t made a remote-tracking branch in your local clone.