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

Re: How do I apply a single "change"

From
Andreas Ericsson <ae@op5.se>
Date
Jan 8, 2006, 01:19 UTC
Message-ID
<43C06892.2030709@op5.se>
In-Reply-To
<20060108005152.46315.qmail@web31813.mail.mud.yahoo.com>
Luben Tuikov wrote:
Show 11 quoted lines
> --- Junio C Hamano <junkio@cox.net> wrote:
>>
>>$ git-cherry-pick $object_name
> 
> 
> Ok, so git searches the db (other branches, etc) and
> does the job.  This worked for me.
> 
> How will I do this same thing but if the "change" is
> on a remote repository?
> 

You can't. cherry-pick doesn't work on remote repos, so you need to pull that branch to a local one first.

Show 21 quoted lines
> 
>>>Alternatively, how do I apply the absolute output of
>>>"git-format-patch".  I tried but whatever I tried with
>>>complained that it couldn't find any email addressess.
>>>(roll eyes here)
>>
>>It is unclear what you mean by absolute output, but here is what
>>I regularly do:
>>
>>$ git-format-patch -k -m --stdout from to | git am -3 -k
> 
> 
> I did 
> $ git-format-patch commit^ commit
> 
> and the usual 0001-blah-blah file got created.  Then
> I tried to apply it, but whatever I tried it complained.
> Will "git-am -3 -k" work without complaining there is
> no "email field" or something?  (I cannot try it as
> git-cherry-pick worked for me already.)
> 

You need to specify the '--mbox' (or '-m') for git-format-patch, otherwise it can't find author-info in the generated patch and it won't know who committed what.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Luben TuikovNext: Linus Torvalds
Message 4 of 5 in “How do I apply a single "change"”
  1. Luben TuikovJan 8, 2006
  2. Junio C HamanoJan 8, 2006
  3. Luben TuikovJan 8, 2006
  4. Andreas EricssonJan 8, 2006
  5. Linus TorvaldsJan 8, 2006

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.