git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Chris Packham <judge.packham@gmail.com>
Date
Mar 2, 2009, 01:58 UTC
Message-ID
<a038bef50903011758v11706f27v897df8b6d0d9ca7c@mail.gmail.com>
In-Reply-To
<22280717.post@talk.nabble.com>
On Mon, Mar 2, 2009 at 2:44 PM, NewToGit <omarnetbox@gmail.com> wrote:
Show 13 quoted lines
> 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.

Previous: NewToGitNext: Chris Packham
Message 2 of 3 in “Applying the changes of a specific commit from one branch to another.”
  1. NewToGitMar 2, 2009
  2. Chris PackhamMar 2, 2009
  3. Chris PackhamMar 2, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.