git

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 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(repoRoot, path, branch string) error

func DefaultBranchMergeRef added in v1.5.0

func DefaultBranchMergeRef(repoRoot string) (string, error)

DefaultBranchMergeRef returns the fully qualified ref used for merge safety checks. Repositories with origin use the current remote default tracking ref and fail closed if that local tracking ref does not match remote HEAD; local-only repositories use the local default branch ref.

func DetachWorktree added in v1.3.2

func DetachWorktree(worktreePath string) error

func Fetch

func Fetch(repoRoot string) error

func FindMainRepoRootFrom added in v1.6.0

func FindMainRepoRootFrom(dir string) (string, error)

FindMainRepoRootFrom returns the main repository root for dir. For linked worktrees, it resolves the worktree root back to the owning repository.

func FindRepoRoot

func FindRepoRoot() (string, error)

func FindRepoRootFrom added in v1.2.0

func FindRepoRootFrom(dir string) (string, error)

func GetDefaultBranch

func GetDefaultBranch(repoRoot string) (string, error)

func GetRemoteURL

func GetRemoteURL(repoRoot string) (string, error)

func HasRemote

func HasRemote(repoRoot, name string) bool

func IsDirty

func IsDirty(worktreePath string) (bool, error)

IsDirty reports tracked or untracked changes, ignoring status.showUntrackedFiles.

func IsHeadMergedIntoDefault added in v1.5.0

func IsHeadMergedIntoDefault(repoRoot, worktreePath string) (bool, string, error)

IsHeadMergedIntoDefault reports whether HEAD is merged into DefaultBranchMergeRef.

func IsHeadMergedIntoRef added in v1.5.0

func IsHeadMergedIntoRef(worktreePath, ref string) (bool, error)

IsHeadMergedIntoRef reports whether worktreePath's HEAD is an ancestor of ref.

func RemoveCleanWorktree added in v1.5.0

func RemoveCleanWorktree(repoRoot, path string) error

RemoveCleanWorktree removes a clean git worktree without forcing deletion.

func RemoveWorktree

func RemoveWorktree(repoRoot, path string) error

func ResetWorktree

func ResetWorktree(worktreePath, branch string) error

func ShortHash

func ShortHash(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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