Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013 - Git - Fetch remote branches

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:

enter image description here

like image 334
Chris Story Avatar asked Sep 17 '15 20:09

Chris Story


People also ask

How do I fetch changes from a remote branch in git Visual Studio?

Open the Team Explorer and open the Sync view. Then select the Pull link under Incoming Commits to pull remote changes and merge them into your local branch. Pulling updates files in your open project, so make sure to commit your changes before pulling. In Team Explorer, select the Home button and choose Sync.

How do I fetch all remote branches?

To view your remote branches, simply pass the -r flag to the git branch command. You can inspect remote branches with the usual git checkout and git log commands. If you approve the changes a remote branch contains, you can merge it into a local branch with a normal git merge .

How do I find the remote branch in Visual Studio?

Find the remote branch in remotes -> origin , then double-click that branch to get it selected locally.


1 Answers

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

enter image description here

like image 114
Chris Story Avatar answered Oct 16 '22 14:10

Chris Story