From: "Nguyen Thai Ngoc Duy" <pclouds@gmail.com>
To: "Bill Lear" <rael@zopyra.com>
Cc: git@vger.kernel.org
Subject: Re: How to archive repo from sub-directory
Date: Tue, 11 Mar 2008 10:22:54 +0700 [thread overview]
Message-ID: <fcaeb9bf0803102022s3cefd1d0jcea74fcf5ac69f6c@mail.gmail.com> (raw)
In-Reply-To: <18389.54080.211086.922039@lisa.zopyra.com>
On Tue, Mar 11, 2008 at 7:33 AM, Bill Lear <rael@zopyra.com> wrote:
> If I have a git repo with several levels of sub-directories, how
> do I get git-archive to archive the entire tree, and not just
> the tree from where I am? Example:
>
> % cd foo
> % cat .git/description
> foo project
> % cd bar/baz
> % git archive --format=tar --prefix=foo/ HEAD | bzip2 > foo.tar.bz2
>
> produces a tar file starting only at baz.
>
> If I can't conjur this on the command line with a clever argument to
> git archive (I've tried several), then how would I ask git "What is
> your top-level directory" so at least I could write a script to
> do this?
You can move back to top-level dir with "cd $(git rev-parse
--show-cdup)". Another way is take "git rev-parse --show-prefix"
result (which would be "bar/baz/") and process it yourself.
--
Duy
prev parent reply other threads:[~2008-03-11 3:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-11 0:33 How to archive repo from sub-directory Bill Lear
2008-03-11 3:22 ` Nguyen Thai Ngoc Duy [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=fcaeb9bf0803102022s3cefd1d0jcea74fcf5ac69f6c@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=rael@zopyra.com \
/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).