Re: how to git-archive ignore some files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sean Estabrooks schrieb:
> On Tue, 06 May 2008 15:15:31 -0300
> Victor Bogado da Silva Lins <victor@xxxxxxxxxx> 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. 
>>
> 
> Hi Victor,
> 
> You can do something like:
> 
> git archive HEAD  | \
> 	tar --delete .gitignore .mailmap .gitattributes | \
> 	bzip2 -c > archive.tar.bz2

Or, if there is only a small number of files in your repository, you
could do something like this:

   git archive HEAD -- \
      $(git ls-tree -r --name-only HEAD | grep -v '^\.gitignore$')

To really solve this without external tools, git-archive needed to grow
an --exclude option like git-ls-files, though.

René

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux