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
Visual Studio 2013 - Git - Fetch remote branches
提问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:
下面是一张图片:
回答by Chris Story
To perform the equivalent of git fetch
from the Git Team Explorer tools with Visual Studio 2013, you have to:
要git fetch
使用 Visual Studio 2013执行来自 Git Team Explorer 工具的等效操作,您必须:
- Go to the Unsynced Commitstab
- Switch to a branch that has remote tracking (I always use master)
- Click Fetchunder the Incoming Commitssection
- 转到未同步提交选项卡
- 切换到具有远程跟踪的分支(我总是使用 master)
- 单击“传入提交”部分下的“获取”
Now, your remote branch list will be up to date and you can create a new branch that tracks the origin/dev
branch
现在,您的远程分支列表将是最新的,您可以创建一个跟踪该origin/dev
分支的新分支