Thread (3 messages) flat view 3 messages, 2 authors, 2018-01-31

Re: Creating sparse checkout in a new linked git worktree

From: Jessie Hernandez <hidden>
Date: 2018-01-30 14:25:31

On Wed, Jan 24, 2018 at 11:11 AM, Jessie Hernandez
[off-list ref] wrote:
quoted
I am trying to get a sparse checkout in a linked worktree but cannot
get
quoted
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



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help