简体   繁体   English

如何在 VS Code 远程容器中拉取特定的远程分支

[英]How to pull specific remote branch in VS Code Remote Container

Is it possible to checkout a specific branch to the container Repo as done by the following command on a "normal" cloned Repo?是否可以通过以下命令在“正常”克隆的 Repo 上签出特定分支到容器 Repo?

git clone --branch <branchname> <remote-repo-url>

I have one branch, which I started to work on in a container but the vscode extension only allows "Clone Repo":我有一个分支,我开始在容器中工作,但 vscode 扩展只允许“克隆回购”:

在此处输入图像描述

If I clone the Repo on another machine, I am facing an issue due to checkout other remote branches.如果我在另一台机器上克隆 Repo,我会因为签出其他远程分支而面临问题。

Ok, I guess it works, if I use the shell command shown above:好的,我想它可以工作,如果我使用上面显示的 shell 命令:

git clone --branch <branchname> <remote-repo-url>

Afterwards I can open the entire folder within vscode.之后我可以在 vscode 中打开整个文件夹。 If Remote-Container Extension is installed, enabled the branch is already set up with a devcontainer.json, a pop-up window will allow you to open the current branch in a container.如果安装了远程容器扩展,启用分支已经设置了 devcontainer.json,弹出 window 将允许您在容器中打开当前分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM