# Push merges?

2 messages from 2008-03-26 to 2008-03-27. Participants: Ryan Leigh, Jeff King.
Thread: https://gitlist.dev/t/12882

## Ryan Leigh, 2008-03-26 21:52

Subject: Push merges?
Message-ID: <ba5eca00803261452r4b5a7b6bi600c30e79b945477@mail.gmail.com>
URL: https://gitlist.dev/e/ba5eca00803261452r4b5a7b6bi600c30e79b945477%40mail.gmail.com

```
Hello all,

I've been getting to know git and I've stumbled across a "problem" and
I haven't yet been able to find a solution. For example, say I have a
branch "base" and two branches of that "foo" and "bar". I make some
change in "base", commit it, and now I would like to have it in both
"foo" and "bar". Is there a command that rather than get another
branch and merge with the current branch will instead take the current
branch and apply a merge on other branches? I've done google searches
and looking through documentation and tutorials and I can't seem to
find an answer one way or another. I wanted to make sure that before I
go write some script to handle it that what I am looking for isn't
already a feature.

Thank you,
Ryan

```

## Jeff King, 2008-03-27 03:09

Subject: Re: Push merges?
Message-ID: <20080327030935.GA4974@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20080327030935.GA4974%40coredump.intra.peff.net
In-Reply-To: <ba5eca00803261452r4b5a7b6bi600c30e79b945477@mail.gmail.com>

```
On Wed, Mar 26, 2008 at 02:52:06PM -0700, Ryan Leigh wrote:

> I've been getting to know git and I've stumbled across a "problem" and
> I haven't yet been able to find a solution. For example, say I have a
> branch "base" and two branches of that "foo" and "bar". I make some
> change in "base", commit it, and now I would like to have it in both
> "foo" and "bar". Is there a command that rather than get another
> branch and merge with the current branch will instead take the current
> branch and apply a merge on other branches? I've done google searches

No, there isn't such a command. Merges must be done one at a time
because they use the index and working tree to report conflicts.

So what you are asking for is the moral equivalent of:

  for i in foo bar; do
    git checkout $i && git merge master
  done

and you could do it that way, except that the 'merge' step may fail with
conflicts that need to be fixed up by hand.

-Peff

```
