In yesterday’s example, you saw how to create a local branch from a remote tracking branch. In today’s tip, you’ll download new changes from the server into your local branch.
Suppose you know there are changes on a GitHub repo (in today’s example) you want to download to your computer.
First, switch to the branch you want to pull down, e.g. `for-review` is the branch with the changes I want. You can go to Team Explorer – Sync pane and click Fetch under Incoming Commits (or at the top of the pane).
After fetching, the window will show the new commits that have been downloaded but not applied to my local branch. That’s why this says “Incoming Commits”. The remote tracking branch remotes/for-review has these two commits (downloaded somewhere – not sure exactly where) but they have not been merged into your local branch (because we only “Fetched” the incoming commits, but haven’t done anything with them yet.)
Now suppose you are ready to do something with these “incoming commits”, i.e. get the into your local branch `for-review`. Remember, your local branch is a just branch of the remote tracking branch, so you need to merge these 2 commits from the remote tracking branch into your local branch.
The only thing that should look differently is the from branch name “origin/for-review”.
Click Merge to merge in the two incoming commits from the remote branch.
Go to View history to see the resulting timeline.
Sync will show 0 incoming commits now that they have been merged.
Yep, I already know what you’re thinking. I’m breaking down the steps manually and there’s this thing call Pull. Stay tuned to tomorrow’s tip 🙂