Documentation
¶
Index ¶
- func Add(repoPath string, branch string) (string, error)
- func AddNewBranch(repoPath string, branch string) (string, error)
- func Fetch(repoPath string) error
- func ListAvailableBranches(repoPath string) ([]string, error)
- func ListBranches(repoPath string) ([]string, error)
- func ListRemoteBranches(repoPath string) ([]string, error)
- func Remove(repoPath string, wtPath string, force bool) error
- func WorktreePath(repoPath string, branch string) string
- type Info
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add creates a new worktree at the computed path for the given branch. Uses --guess-remote so that remote-tracking branches are automatically checked out as new local tracking branches.
func AddNewBranch ¶
AddNewBranch creates a new worktree with a new branch.
func ListAvailableBranches ¶
ListAvailableBranches returns all branch names (local + remote-only, deduplicated). Remote-only branches are returned without the remote prefix (e.g. "feature-x" not "origin/feature-x").
func ListBranches ¶
ListBranches returns local branch names for the repo.
func ListRemoteBranches ¶
ListRemoteBranches returns remote-tracking branch names (e.g. "origin/feature-x").
func WorktreePath ¶
WorktreePath computes the path for a new worktree. Convention: <repo-parent>/<repo-name>-<branch>