How do I merge another developer's branch into mine?

Viewed 150217

I am relatively new to git. Our organization uses a Fork & Pull Model for managing changes to the master branch. Each developer forks the master and branches from their fork when adding new features. I keep an eye on commits that other developers are making in their own branches, and would sometimes like to merge these changes into my own branch. What steps do I take to accomplish this?

4 Answers

You can also do "git pull", it'll pull the changes of all the branches.

git pull

You can run git merge into your current branch

git merge origin <branchname>

Let's say you are currently working on branch feature/feature_a and you want to merge the changes made in another branch called feature/feature_b to feature/feature_a. The following commands should do the trick:

git checkout feature/feature_b
git pull
git checkout feature/feature_a
git merge feature/feature_b
Related