Git: Update Changes from Remote Master into Local Feature Branch

By Henri Parviainen

How to update remote master branch in to local feature branch

Are you in a situation where another developer working on the same project has updated the remote master branch and you need those changes in your local feature branch?

This guide will help you through the process of getting your local feature branch up to date with the remote master.

The first step in the process is getting the changes from remote master into your local master branch.

So, let's first switch our current branch to master.

$ git checkout master

Next, we'll need to pull all the changes from remote master into your local master.

$ git pull origin master

Once we have our local master up to date with the remote master branch, we can switch our current branch back to the feature.

$ git checkout <feature-branch>

Now we are ready to merge our local master with the currently active feature branch.

$ git merge master

And now we have all the changes that were made to the remote master in our local feature branch.

SHARE