# Applying the changes of a specific commit from one branch to another.

3 messages from 2009-03-02 to 2009-03-02. Participants: NewToGit, Chris Packham.
Thread: https://gitlist.dev/t/18085

## NewToGit, 2009-03-02 01:44

Subject: Applying the changes of a specific commit from one branch to another.
Message-ID: <22280717.post@talk.nabble.com>
URL: https://gitlist.dev/e/22280717.post%40talk.nabble.com

```

Applying the changes of a specific commit from one branch to another.

Scenario:

- branched off master and created story123 branch.
- made three separate change commits to story123:
	- 'fixed bug123'
	- 'fixed bug456'
	- 'fixed bug789'

- now I realized that I need to apply only one commit 'fixed bug789' to
master

Question: What's the best way to go about doing this?

Thanks for the help!

NewToGit

-- 
View this message in context: http://www.nabble.com/Applying-the-changes-of-a-specific-commit-from-one-branch-to-another.-tp22280717p22280717.html
Sent from the git mailing list archive at Nabble.com.

```

## Chris Packham, 2009-03-02 01:58

Subject: Re: Applying the changes of a specific commit from one branch to another.
Message-ID: <a038bef50903011758v11706f27v897df8b6d0d9ca7c@mail.gmail.com>
URL: https://gitlist.dev/e/a038bef50903011758v11706f27v897df8b6d0d9ca7c%40mail.gmail.com
In-Reply-To: <22280717.post@talk.nabble.com>

```
On Mon, Mar 2, 2009 at 2:44 PM, NewToGit <omarnetbox@gmail.com> wrote:
> Scenario:
>
> - branched off master and created story123 branch.
> - made three separate change commits to story123:
>        - 'fixed bug123'
>        - 'fixed bug456'
>        - 'fixed bug789'
>
> - now I realized that I need to apply only one commit 'fixed bug789' to
> master
>
> Question: What's the best way to go about doing this?
>

What you want to do is "cherry-pick" the commit 'fixed bug789'. With
git there are several ways to do this but the one I'd use is the
cherry-pick functionality of gitk.

git checkout master
gitk --all
<right click on the 'fixed bug789' commit and select "cherry-pick this commit">

Like I say there are plenty of ways to do something like this. I'm
sure you'll get plenty more responses.

```

## Chris Packham, 2009-03-02 02:52

Subject: Re: Applying the changes of a specific commit from one branch to another.
Message-ID: <a038bef50903011852m1394d444tac5462d3a03906bb@mail.gmail.com>
URL: https://gitlist.dev/e/a038bef50903011852m1394d444tac5462d3a03906bb%40mail.gmail.com
In-Reply-To: <22d8f6460903011824t18c01d83p16c05af9f9a12ee5@mail.gmail.com>

```
On Mon, Mar 2, 2009 at 3:24 PM, omar-uk <omarnetbox@googlemail.com> wrote:
> Many Thanks Chris! for the quick response.
>
> What I do right click on? I tried the commit message but not getting
> any menus or anything. BTW I'm using a mac not sure if it makes a
> difference.

Hmm, Doesn't mac imply only one mouse button? Anyway whatever the
equivalent to right click is you click on the headline (also referred
to as the subject) in the tree (top half of the gitk window).

Also for mac a lot of people are using GitX which has similar
functionality to gitk (I can't claim any knowledge about it).

```
