git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jessie Hernandez" <git@jessiehernandez.com>
To: "Eric Sunshine" <sunshine@sunshineco.com>
Cc: git@jessiehernandez.com, "Git List" <git@vger.kernel.org>
Subject: Re: Creating sparse checkout in a new linked git worktree
Date: Tue, 30 Jan 2018 15:25:04 +0100	[thread overview]
Message-ID: <615c04025165d0dff9d6e6b66bf11a41.squirrel@mail.jessiehernandez.com> (raw)

> On Wed, Jan 24, 2018 at 11:11 AM, Jessie Hernandez
> <git@jessiehernandez.com> wrote:
>> I am trying to get a sparse checkout in a linked worktree but cannot
get
>> it working. I have tried the following
>> * git worktree add /some/new/path/new-branch --no-checkout
>> * git config core.sparseCheckout true
>> * <add the directory I would like to checkout out to
>> $GIT_DIR/info/sparse-checkout>
>> * cd  /some/new/path/new-branch
>> * git read-tree -mu sparse-checkout
>> But I still end up with a fully populated worktree.
>> Is there something I am missing or doing wrong?
> The sparse-checkout file is specific to each worktree, which allows you
to control "sparsity" on a worktree by worktree basis. Therefore, you
should create $GIT_DIR/worktrees/<id>/info/sparse-checkout instead
(where <id> is "new-branch" in your example).

Right this seems to work indeed.
Thank you.

Would it help if this was added to the documentation of git-read-tree

Regards,
Jessie





             reply	other threads:[~2018-01-30 14:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30 14:25 Jessie Hernandez [this message]
2018-01-30 19:00 ` Creating sparse checkout in a new linked git worktree Eric Sunshine
2018-01-31 10:03   ` Jessie Hernandez
  -- strict thread matches above, loose matches on Subject: below --
2018-01-24 16:11 Jessie Hernandez
2018-01-28  7:25 ` Eric Sunshine
2018-01-28  9:40   ` Duy Nguyen

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=615c04025165d0dff9d6e6b66bf11a41.squirrel@mail.jessiehernandez.com \
    --to=git@jessiehernandez.com \
    --cc=git@jessiehernandez.co \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.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).