Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

People also ask

How do I merge development branch?

Merge your "dev" branch into the "master". git checkout dev # switch to "dev" branch if you're not already. git merge master # optionally, this command is being used to resolve any conflicts if you pushed any changes to your "master" but "dev" doesn't have that commit.


You first need to add the other developer repository as a remote.

git remote add otherrep uriToOtherRep

Then you fetch changes from there

git fetch otherrep

And then you merge the branch from the remote repository into yours

git merge otherrep/branchname

Happy merging!


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

once you have the branch in question in your repository as, say, anotherdev/master remote branch, you do the git merge anotherdev/master.