Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateWorktree ¶
CreateWorktree creates a new worktree at targetDir for the given branch. If branch doesn't exist and createBranch is true, it will create it from current HEAD. targetDir may be relative; we create parent directories as needed.
func CreateWorktreeFromRef ¶
CreateWorktreeFromRef creates a new branch from a given ref and adds a worktree. Equivalent to: git worktree add -b <branch> <path> <fromRef>
func DefaultWorktreeDir ¶
DefaultWorktreeDir suggests a directory name for a branch under .worktrees/<branch>
func ListBranches ¶
ListBranches returns local branches without the leading '*'
func RemoveWorktree ¶
RemoveWorktree removes a worktree by path. If force is true, uses --force.
Types ¶
type Branch ¶
type Branch struct {
Name string // short name without remote prefix
IsRemote bool
Remote string // e.g. "origin" if remote
RemoteRef string // e.g. "origin/feature"
}
Branch represents a git branch, local or remote.
func ListBranchesDetailed ¶
ListBranchesDetailed returns local and remote branches, with local first.