Visual Studio 2013 - Git - 获取远程分支

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32639104/
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 11:24:16  来源:igfitidea点击:

Visual Studio 2013 - Git - Fetch remote branches

gitvisual-studio-2013azure-devops

提问by Chris Story

I am starting to use Visual Studio 2013 with the built-in Git Team Explorer tools using Visual Studio Online. I am very familiar with how to do this via the Git Shell but cannot seem to figure out how to do this via the VS 2013 interface.

我开始使用 Visual Studio 2013 和内置的 Git Team Explorer 工具使用 Visual Studio Online。我非常熟悉如何通过 Git Shell 执行此操作,但似乎无法弄清楚如何通过 VS 2013 界面执行此操作。

I am trying to pull a remote branch locally and am unable to do so. Via command line, I would do:

我试图在本地拉一个远程分支,但无法这样做。通过命令行,我会这样做:

git fetch -a
git checkout <branchName>

I understand the workflow is to create a local branch that tracks the remote branch; however, my remote branch list in the dropdown is not complete. How do I perform this action which mimics git fetch -a?

我了解工作流程是创建一个跟踪远程分支的本地分支;但是,下拉列表中的远程分支列表不完整。我如何执行这个模仿的动作git fetch -a

Below is a picture:

下面是一张图片:

enter image description here

在此处输入图片说明

回答by Chris Story

To perform the equivalent of git fetchfrom the Git Team Explorer tools with Visual Studio 2013, you have to:

git fetch使用 Visual Studio 2013执行来自 Git Team Explorer 工具的等效操作,您必须:

  1. Go to the Unsynced Commitstab
  2. Switch to a branch that has remote tracking (I always use master)
  3. Click Fetchunder the Incoming Commitssection
  1. 转到未同步提交选项卡
  2. 切换到具有远程跟踪的分支(我总是使用 master)
  3. 单击“传入提交”部分下的“获取

Now, your remote branch list will be up to date and you can create a new branch that tracks the origin/devbranch

现在,您的远程分支列表将是最新的,您可以创建一个跟踪该origin/dev分支的新分支

enter image description here

在此处输入图片说明