Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge multiple branches in single branch in git

I have a master branch and multiple test branches. I need to create a local test(some branch)branch and merge all the existing test branches into the newly created local branch and resolve the conflicts.

So far, I have created a local branch after cloning as follows:

  • git clone <remote url>
  • git branch <some branch>

Now, how do I proceed further? I new to git. Help would be appreciated.

like image 755
kittu Avatar asked Dec 05 '25 00:12

kittu


1 Answers

Assuming you want to base your merge-target branch off master, you could try the following:

git checkout master
git checkout -b test-merge    # create the new branch

And then just merge each of the test branches into test-merge:

git merge test1
# resolve conflicts, commit
git merge test2
# resolve again, etc.
like image 74
Tim Biegeleisen Avatar answered Dec 07 '25 15:12

Tim Biegeleisen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!