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

Re: git cherry-pick before archive

From
Denis Bueno <dbueno@gmail.com>
Date
Jul 11, 2008, 16:18 UTC
Message-ID
<6dbd4d000807110918s1187abeaye6f249ff60b650fb@mail.gmail.com>
In-Reply-To
<20080711161158.GD10347@genesis.frugalware.org>
On Fri, Jul 11, 2008 at 12:11, Miklos Vajna <vmiklos@frugalware.org> wrote:
Show 8 quoted lines
> On Fri, Jul 11, 2008 at 12:09:02PM -0400, Denis Bueno <dbueno@gmail.com> wrote:
>> On Fri, Jul 11, 2008 at 11:51, Johannes Schindelin
>> <Johannes.Schindelin@gmx.de> wrote:
>> > $ git cherry-pick -n <bla>
>> > $ git archive --format=tar --prefix=pfx/ $(git write-tree) | gzip > prj.tgz
>> > $ git reset
>
> I guess he wanted to write 'git reset --hard' here ;-)

But that will undo local modifications to any uncommitted files, not just those affected by the cherry-pick. I don't want to do that.

Show 9 quoted lines
>> Thank you!  This is much better.  The only thing that could improve it
>> is by some way to "un-cherry-pick" the applied change (so that after
>> "git reset" there are no local modifications to the file(s) changed by
>> cherry-picking <bla>).
>>
>> Is there an easy way to invert a patch to undo the change the original
>> patch introduced?
>
> git show <commit> | git apply -R?
Brilliant!  Thanks.  I didn't know about apply (or show for that matter ....).
-- 
 Denis
Previous: Miklos VajnaNext: Johannes Schindelin
Message 5 of 11 in “git cherry-pick before archive”
  1. Denis BuenoJul 11, 2008
  2. Johannes SchindelinJul 11, 2008
  3. Denis BuenoJul 11, 2008
  4. Miklos VajnaJul 11, 2008
  5. Denis BuenoJul 11, 2008
  6. Johannes SchindelinJul 11, 2008
  7. Denis BuenoJul 11, 2008
  8. Johannes SchindelinJul 11, 2008
  9. Denis BuenoJul 11, 2008
  10. Johannes SchindelinJul 11, 2008
  11. Junio C HamanoJul 11, 2008

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.