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

Re: git cherry-pick before archive

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 11, 2008, 22:18 UTC
Message-ID
<7vzloohxo1.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.1.00.0807111649290.8950@racer>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 22 quoted lines
> Hi,
>
> On Fri, 11 Jul 2008, Denis Bueno wrote:
>
>> I'm trying to use git archive to create a kind of "release" tarball of
>> my source.  I've got a patch (a commit) that I'd like to apply to the
>> tree before I call git archive on HEAD.  Currently my command is:
>> 
>>     git archive --format=tar --prefix=pfx/ HEAD | gzip > prj.tgz
>> 
>> If I were to actually modify my tree & history, I'd change the command to:
>> 
>>     git cherry-pick 97a1235ce674f7cf4df3129cd0ab1ae0793db392
>>     git archive --format=tar --prefix=pfx/ HEAD | gzip > prj.tgz
>>     git reset --hard HEAD^
>> 
>> But I'd rather not modify my history, if it's possible.  (This will
>> create a bunch of dangling commit objects over time, no?)
>
> $ git cherry-pick -n <bla>
> $ git archive --format=tar --prefix=pfx/ $(git write-tree) | gzip > prj.tgz
> $ git reset
That will create a bunch of dangling tree objects over time, yes.
Previous: Johannes Schindelin
Message 11 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.