You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to create a worktree for an existing directory - but I don't want to add a branch in it. As far as I understand, in git CLI I can do this with git worktree add --detach PATH. Is there a way to do that in libgit2, or am I misunderstanding how that CLI feature works?
I understand to create a worktree in libgit2 I need to use git_worktree_add(). However, by default it seems to create a new branch based on the passed name argument. Is it possible to call it in some way that would not create a new branch, and just use HEAD or any passed reference in a detached mode?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to create a worktree for an existing directory - but I don't want to add a branch in it. As far as I understand, in git CLI I can do this with
git worktree add --detach PATH
. Is there a way to do that in libgit2, or am I misunderstanding how that CLI feature works?I understand to create a worktree in libgit2 I need to use git_worktree_add(). However, by default it seems to create a new branch based on the passed
name
argument. Is it possible to call it in some way that would not create a new branch, and just use HEAD or any passed reference in a detached mode?Beta Was this translation helpful? Give feedback.
All reactions