0

How to pull master branch changes over a feature branch using git bash or visual studio code ?

There is a master branch, from which I created feature branch. I have made changes and also pushed my changes to feature branch. Assume master branch is updated with code changes by other developers. Now I need to get updated master branch code to my Feature branch. How to proceed? Provide solutions with git cmd or visual studio code IDE.

swank
  • 51
  • 1
  • 9
  • 2
    Possible duplicate of [Get changes from master into branch in Git](https://stackoverflow.com/questions/5340724/get-changes-from-master-into-branch-in-git) – mkrieger1 Apr 25 '19 at 16:01

3 Answers3

3

A classic process would be to

git checkout master
git pull
git checkout feature
git merge master

(alternatively, depending on your workflow, rebase instead of merge)

Romain Valeri
  • 19,645
  • 3
  • 36
  • 61
3

In visual studio code, use source control icon -> click Pull from -> click the repository path -> click master branch name.

At bottom of the visual studio code click on sync option to pull and push changes to feature branch.

This will update feature branch with master branch code.

swank
  • 51
  • 1
  • 9
0
git fetch master:master
git merge master

or even quicker without modifying local master :

git pull origin master
airtonix
  • 4,772
  • 2
  • 38
  • 36