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

Re: how to git-archive ignore some files?

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 8, 2008, 20:22 UTC
Message-ID
<alpine.DEB.1.00.0805082118390.30431@racer>
In-Reply-To
<20080508170442.GK9562@eratosthenes.sbcglobal.net>
Hi,
On Thu, 8 May 2008, David Bryson wrote:
Show 9 quoted lines
> On Tue, May 06, 2008 at 03:15:31PM -0300 or thereabouts, Victor Bogado da Silva Lins wrote:
> > I want to use git-archive to create source packages, but my git 
> > repository has a .gitignore that I don't want to be pushed into the 
> > archive. So is it possible to keep the .gitignore file in the 
> > repository and create an archive(*) without it?
> > 
> > *) using git-archive, off course. 
> 
> Others already discussed the --delete method with tar, [...]

I wonder if the most natural way with Git would not be to create a throw-away tree:

cp .git/index .git/tmp-index && GIT_INDEX_FILE=.git/tmp-index git rm --cached .gitignore && git archive $(GIT_INDEX_FILE=.git/tmp-index git write-tree) && rm .git/tmp-index

WARNING: this has not seen any testing.

Ciao, Dscho

Previous: David Bryson
Message 10 of 10 in “how to git-archive ignore some files?”
  1. Victor Bogado da Silva LinsMay 6, 2008
  2. Sean EstabrooksMay 6, 2008
  3. René ScharfeMay 6, 2008
  4. Junio C HamanoMay 6, 2008
  5. René ScharfeMay 11, 2008
  6. Junio C HamanoMay 11, 2008
  7. Jakub NarebskiMay 12, 2008
  8. René ScharfeJun 8, 2008
  9. David BrysonMay 8, 2008
  10. Johannes SchindelinMay 8, 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.