Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge two branches not master

Tags:

git

merge

github

I have a branch I created which is a decendant of master.

master -> mybranch

I now need to merge in code from things/bugfix into mybranch

master -> things/bugfix

So I need things/bugfix code to be in mybranch

like image 675
jdog Avatar asked Aug 01 '14 14:08

jdog


People also ask

How do I merge two branches together?

To merge branches locally, use git checkout to switch to the branch you want to merge into. This branch is typically the main branch. Next, use git merge and specify the name of the other branch to bring into this branch. This example merges the jeff/feature1 branch into the main branch.

Can you merge two branches in git?

Git merge will combine multiple sequences of commits into one unified history. In the most frequent use cases, git merge is used to combine two branches.

How do I merge branches from one branch?

Select the branch that you want to merge into the current branch, click Modify options and choose from the following: --no-ff : a merge commit will be created in all cases, even if the merge could be resolved as a fast-forward. --ff-only : the merge will be resolved only if it is possible to fast-forward.


1 Answers

First checkout mybranch :

git checkout mybranch

Then merge things/bugfix into mybranch :

git merge things/bugfix

like image 159
Eran Avatar answered Sep 27 '22 17:09

Eran