Documentation
¶
Index ¶
- func BranchDelete(branch string, force bool) error
- func BranchExists(branch string) bool
- func Command(args ...string) error
- func CommandOutput(args ...string) (string, error)
- func CommandOutputAt(path string, args ...string) (string, error)
- func CommandSilent(args ...string) error
- func Fetch(refs ...string) error
- func GetCurrentBranch(path string) (string, error)
- func GetCurrentBranchAtCwd() (string, error)
- func GetGitRoot() (string, error)
- func GetRepoName() (string, error)
- func GetWorktreeBranch(worktreePath string) (string, error)
- func HasUncommittedChanges(worktreePath string) bool
- func IsGitRepository(path string) bool
- func WorktreeAdd(branch, worktreePath string) error
- func WorktreeAddFromBranch(branch, worktreePath string) error
- func WorktreeAddFromRef(branch, worktreePath, ref string) error
- func WorktreeIsRegistered(worktreePath string) bool
- func WorktreePrune() error
- func WorktreeRemove(worktreePath string, force bool) error
- type WorktreeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchDelete ¶
BranchDelete deletes a branch.
func BranchExists ¶
BranchExists checks if a branch exists in the repository.
func CommandOutput ¶
CommandOutput runs a git command and returns the output from current directory.
func CommandOutputAt ¶
CommandOutputAt runs a git command and returns the output from specified directory.
func CommandSilent ¶
CommandSilent runs a git command without output in the current directory.
func GetCurrentBranch ¶
GetCurrentBranch returns the current branch name in the specified directory.
func GetCurrentBranchAtCwd ¶
GetCurrentBranchAtCwd returns the current branch name at current working directory.
func GetGitRoot ¶ added in v0.0.4
GetGitRoot returns the git root directory.
func GetRepoName ¶ added in v0.0.2
GetRepoName returns the repository name from the current working directory.
func GetWorktreeBranch ¶
GetWorktreeBranch returns the branch that a worktree is on.
func HasUncommittedChanges ¶
HasUncommittedChanges checks if a worktree has uncommitted changes.
func IsGitRepository ¶
IsGitRepository checks if a directory is a git repository.
func WorktreeAdd ¶
WorktreeAdd adds a worktree with a new branch.
func WorktreeAddFromBranch ¶
WorktreeAddFromBranch adds a worktree from an existing branch.
func WorktreeAddFromRef ¶
WorktreeAddFromRef adds a worktree from a specific ref.
func WorktreeIsRegistered ¶
WorktreeIsRegistered checks if a worktree path is registered in git.
func WorktreeRemove ¶
WorktreeRemove removes a worktree.
Types ¶
type WorktreeInfo ¶
WorktreeInfo represents information about a worktree.
func GetWorktreeInfo ¶
func GetWorktreeInfo() ([]WorktreeInfo, error)
GetWorktreeInfo returns worktree info (path and branch) for all worktrees.