# Committing a change from one branch another branch

4 messages from 2014-03-13 to 2014-03-14. Participants: Jagan Teki, Andreas Schwab, Brandon McCaig.
Thread: https://gitlist.dev/t/36150

## Jagan Teki, 2014-03-13 09:56

Subject: Committing a change from one branch another branch
Message-ID: <CAD6G_RRQVDxQj==-2vAT3WCiYMC=BmZhi__JWi4yy86Uaoa-og@mail.gmail.com>
URL: https://gitlist.dev/e/CAD6G_RRQVDxQj%3D%3D-2vAT3WCiYMC%3DBmZhi__JWi4yy86Uaoa-og%40mail.gmail.com

```
Hi,

I have two branches.
- master-b1
- master-b2

Suppose I'm in master-b1 then did a change
on master-b1
$ git add test/init.c
$ git commit -s -m "init.c Changed!"
$ git log
Author: Jagan Teki <jagannadh.teki@gmail.com>
Date:   Thu Mar 13 00:48:44 2014 -0700

init.c Changed!

$ git checkout master-b2
$ git log
Author: Jagan Teki <jagannadh.teki@gmail.com>
Date:   Thu Mar 13 00:48:44 2014 -0700

init.c Changed!

How can we do this, any idea?

-- 
Jagan.

```

## Andreas Schwab, 2014-03-13 10:21

Subject: Re: Committing a change from one branch another branch
Message-ID: <87bnxav1oy.fsf@igel.home>
URL: https://gitlist.dev/e/87bnxav1oy.fsf%40igel.home
In-Reply-To: <CAD6G_RRQVDxQj==-2vAT3WCiYMC=BmZhi__JWi4yy86Uaoa-og@mail.gmail.com>

```
Jagan Teki <jagannadh.teki@gmail.com> writes:

> How can we do this, any idea?

git cherry-pick

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```

## Brandon McCaig, 2014-03-13 15:36

Subject: Re: Committing a change from one branch another branch
Message-ID: <CANUGeEZc8BoV0MxUGRRGc8SK=-xB2YXoEkRkBTyGZ8FxSjnVTQ@mail.gmail.com>
URL: https://gitlist.dev/e/CANUGeEZc8BoV0MxUGRRGc8SK%3D-xB2YXoEkRkBTyGZ8FxSjnVTQ%40mail.gmail.com
In-Reply-To: <CAD6G_RRQVDxQj==-2vAT3WCiYMC=BmZhi__JWi4yy86Uaoa-og@mail.gmail.com>

```
Jagan:

On Thu, Mar 13, 2014 at 4:56 AM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> Hi,

Hello,

> I have two branches.
> - master-b1
> - master-b2
>
> Suppose I'm in master-b1 then did a change
> on master-b1
> $ git add test/init.c
> $ git commit -s -m "init.c Changed!"
> $ git log
> Author: Jagan Teki <jagannadh.teki@gmail.com>
> Date:   Thu Mar 13 00:48:44 2014 -0700
>
> init.c Changed!
>
> $ git checkout master-b2
> $ git log
> Author: Jagan Teki <jagannadh.teki@gmail.com>
> Date:   Thu Mar 13 00:48:44 2014 -0700
>
> init.c Changed!
>
> How can we do this, any idea?

What you're asking is ambiguous and vague. The example output that you
give doesn't even really make sense. You need to give more details
about what you have and what you want to do to get proper help.

Or join #git on irc.freenode.net for real-time help if you aren't sure
how to explain it.

Regards,


-- 
Brandon McCaig <bamccaig@gmail.com> <bamccaig@castopulence.org>
Castopulence Software <https://www.castopulence.org/>
Blog <http://www.bamccaig.com/>
perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }.
q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.};
tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'

```

## Jagan Teki, 2014-03-14 09:34

Subject: Re: Committing a change from one branch another branch
Message-ID: <CAD6G_RT5mBWUKz18ZkSQkKiMnz8WXRK7scb+_xAscYQX4zR9xw@mail.gmail.com>
URL: https://gitlist.dev/e/CAD6G_RT5mBWUKz18ZkSQkKiMnz8WXRK7scb%2B_xAscYQX4zR9xw%40mail.gmail.com
In-Reply-To: <CANUGeEZc8BoV0MxUGRRGc8SK=-xB2YXoEkRkBTyGZ8FxSjnVTQ@mail.gmail.com>

```
Hi Brandon McCaig,

On Thu, Mar 13, 2014 at 9:06 PM, Brandon McCaig <bamccaig@gmail.com> wrote:
> Jagan:
>
> On Thu, Mar 13, 2014 at 4:56 AM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
>> Hi,
>
> Hello,
>
>> I have two branches.
>> - master-b1
>> - master-b2
>>
>> Suppose I'm in master-b1 then did a change
>> on master-b1
>> $ git add test/init.c
>> $ git commit -s -m "init.c Changed!"
>> $ git log
>> Author: Jagan Teki <jagannadh.teki@gmail.com>
>> Date:   Thu Mar 13 00:48:44 2014 -0700
>>
>> init.c Changed!
>>
>> $ git checkout master-b2
>> $ git log
>> Author: Jagan Teki <jagannadh.teki@gmail.com>
>> Date:   Thu Mar 13 00:48:44 2014 -0700
>>
>> init.c Changed!
>>
>> How can we do this, any idea?
>
> What you're asking is ambiguous and vague. The example output that you
> give doesn't even really make sense. You need to give more details
> about what you have and what you want to do to get proper help.
>
> Or join #git on irc.freenode.net for real-time help if you aren't sure
> how to explain it.

I tried #git irc channel, looks like I'm facing some firewall issue on my end.!
OK - Let me explain my query again.

I've a git repository with 2 branches.
- master-b1
- master-b2

I have to work both these branches since I need two different deliveries.

master-b1 have a contents of
joo_v1/test.txt
joo_v2/test.txt

master-b2
joo/test.txt

Here, joo_v2 on master-b1 is same as joo on master-b2 means the latest updates
on master-b1 with <DIR_NAME>_<VERSION> becomes <DIR> on master-b2

Suppose, if user is change the contents on joo_v2 on master-b1 will change
the contents on joo on master-b2 (files contains particular directories are same
name with same contents - joo_v2/test.txt and joo/text.txt)

The moment user commit the change on master-b1 will create a commit on master-b2

Please let me know if you still need any more information.
I will come to IRC soon, for more discussion.

thanks!
-- 
Jagan.

```
