Skip to content

Creating new worktree for a local repository? #1002

Answered by Byron
NobodyXu asked this question in Q&A
Discussion options

You must be logged in to vote

The Worktree doesn't have any capability to mutate itself yet, nor is there a way to create an official worktree like git worktree add does. However, creating worktree checkouts is relatively straightforward with gix::worktree::state::checkout(). Further, you could create a worktree_stream which allows to examine the whole worktree (as it would be checked out) in memory in a streaming fashion.

Since cargo-binstall controls these directories, getting a plain checkout should be enough.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@NobodyXu
Comment options

@Byron
Comment options

Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants