Git merge other branch into another branch?

Issue

Is it possible to merge other branch into another branch?

For example, I’m in branch1 and want to pull remote/develop into develop branch and then merge develop into current branch1.

What am I doing is checkout develop(maybe stash first), pull, checkout branch1 and then merge develop.

Is it possible to do all these with switch to develop branch ?

Solution

A slightly quicker option would be to (while on branch1):

git fetch
git merge remote/develop

This will get your remote/develop merged into branch1, however it should be noted that your local develop branch won’t be updated.

Answered By – Nick

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published