git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: thomas@koch.ro
Cc: git@vger.kernel.org
Subject: Re: [Feature Request] git export
Date: Tue, 11 Aug 2009 09:50:20 +0200	[thread overview]
Message-ID: <4A8122BC.7030009@drmicha.warpmail.net> (raw)
In-Reply-To: <200908101822.59940.thomas@koch.ro>

Thomas Koch venit, vidit, dixit 10.08.2009 18:22:
> could you please provide a simple solution to save a tree object into an 
> arbitrary location?
> I found some hints, that it would be possible by missusing either git 
> checkout-index or git-archive, but I think that it shouldn't require that much 
> GIT FU to do such a simple thing.
> 
> Thanks,
> 
> Thomas Koch, http://www.koch.ro

To serve you with an explicit command line, it's really only

git archive HEAD | tar -C wheretoexport/ -xf-

which you need to issue from within your git repo. Instead of HEAD, you
can use any "treeish", for example the name of a branch, which need not
be checked out. You can add path arguments after the treeish if you want
to export only parts of your repo.

Note that in true unix philosophy, git archive does the (git specific)
exporting only and leaves the importing into the file system (saving) to
the proper tool. I mean, would you rather use cp -r or pipes with tar
-x/tar -c or cpio -i/-o in order to copy a tree? ;)

Cheers,
Michael

      parent reply	other threads:[~2009-08-11 12:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-10 16:22 [Feature Request] git export Thomas Koch
2009-08-10 16:27 ` Tim Visher
2009-08-10 16:41   ` Thomas Koch
2009-08-10 18:31     ` Tim Visher
2009-08-10 16:54 ` Junio C Hamano
2009-08-10 16:56 ` Johannes Schindelin
2009-08-11  7:50 ` Michael J Gruber [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A8122BC.7030009@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=thomas@koch.ro \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).