git

package
v0.0.0-...-84df7eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddWorktree

func AddWorktree(repoDir, path, branch string, createBranch bool) error

AddWorktree creates a new worktree

func BranchExists

func BranchExists(repoDir, branch string) bool

BranchExists checks if a branch exists

func DeleteBranch

func DeleteBranch(repoDir, branch string, force bool) error

DeleteBranch deletes a local branch

func GetCurrentBranch

func GetCurrentBranch(dir string) (string, error)

GetCurrentBranch returns the current branch name

func GetRepoRoot

func GetRepoRoot(dir string) (string, error)

GetRepoRoot returns the root directory of the git repository

func RemoveWorktree

func RemoveWorktree(repoDir, path string, force bool) error

RemoveWorktree removes a worktree

Types

type Worktree

type Worktree struct {
	Path   string
	HEAD   string
	Branch string
	Bare   bool
}

Worktree represents a git worktree entry

func ListWorktrees

func ListWorktrees(repoDir string) ([]Worktree, error)

ListWorktrees returns all worktrees for a repository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL