-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
libgit2 API:
https://libgit2.org/docs/reference/main/worktree/index.html
I had a use case for git worktrees here:
DavisVaughan/cross#8
Basically I wanted to be on my-branch and be able to:
- Check out
main, install the package atmaininto a specificlibpath - Check out
my-branch, install the package atmy-branchinto a specificlibpath
All while not touching the user's current state while on my-branch
My solution was to:
- Create a temp branch,
main-cross - Create a worktree in a temp dir, checkout out
main-crossthere - Create a temp branch,
my-branch-cross - Create a worktree in a temp dir, checkout out
my-branch-crossthere
This seems like the right way to do this, but it requires me to go to system git calls. I copied some code from pak that does this, but I'm already using gert so it would be nice to just stay in that ecosystem.
I think minimal support for me would look like:
git_worktree_add <- function(dir, branch) {
}
git_worktree_remove <- function(dir) {
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels