Visual Studio 2013 - Git - Fetch remote branches

2019-05-03 13:34发布

问题:

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.

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?

Below is a picture:

回答1:

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

  1. Go to the Unsynced Commits tab
  2. Switch to a branch that has remote tracking (I always use master)
  3. Click Fetch under the Incoming Commits section

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