git 如何在 VS Code 中将特定远程拉入当前分支

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42142490/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 12:36:57  来源:igfitidea点击:

How to pull specific remote into current branch in VS Code

gitvisual-studio-code

提问by stephen776

Using built in Git in Visual Studio Code, I do not see a way to pull a specified remote branch into my current branch. Can I do this?

在 Visual Studio Code 中使用内置 Git,我没有看到将指定的远程分支拉入当前分支的方法。我可以这样做吗?

Example: I am working on branch myBranchand changes were merged into masteron the remote. I want to pull the changes from masterinto my current myBranch

示例:我在分支上工作myBranch,更改已合并到master远程。我想将更改从master我的当前myBranch

采纳答案by Gama11

I don't think there's currently a built-in way to do this, but I've found an extension for it: Git: Pull - Remote/Branch Specified

我认为目前没有内置的方法可以做到这一点,但我找到了它的扩展:Git: Pull - Remote/Branch Specified

It adds a command with the same name, which when invoked, prompts you for the name of the remote and remote branch to pull from:

它添加了一个具有相同名称的命令,当调用该命令时,会提示您输入要从中提取的远程和远程分支的名称:

回答by Yang Wang

I am using Version 1.30.1 (1.30.1) and now it has build-in way to do this.

我正在使用版本 1.30.1 (1.30.1),现在它有内置的方式来做到这一点。

enter image description here

enter image description here

回答by Moumit

Finally i solve it this way

最后我这样解决

File->Preferences->Settings->User (Tab)-> Extentions ->git-> Autofeatch(set checkbox to true)

enter image description here

enter image description here

Now you will able to see remote branches in source controlbranches options

现在您将能够在source control分支选项中看到远程分支