git

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchExists

func BranchExists(branch string) bool

BranchExists checks if a branch exists locally

func Commit

func Commit(message string) error

Commit creates a new commit with the given message

func CommitFromFile

func CommitFromFile(path string) error

CommitFromFile creates a new commit using the contents of a file as the message

func CreateWorktree

func CreateWorktree(path, branch string, createBranch bool) error

CreateWorktree creates a new git worktree

func CurrentBranch

func CurrentBranch() (string, error)

CurrentBranch returns the current branch name

func DeleteBranch

func DeleteBranch(branch string) error

DeleteBranch deletes a local branch

func GitDir

func GitDir() (string, error)

GitDir returns the absolute path to the .git directory

func HasUnmergedFiles

func HasUnmergedFiles() (bool, error)

HasUnmergedFiles checks if there are any unmerged files in the index

func ListWorktrees

func ListWorktrees() ([]string, error)

ListWorktrees returns a list of worktree paths

func RemoveWorktree

func RemoveWorktree(path string) error

RemoveWorktree removes a git worktree

func RepoRoot

func RepoRoot() (string, error)

RepoRoot returns the root directory of the git repository

func SquashMerge

func SquashMerge(branch string) error

SquashMerge performs a squash merge of a branch into current branch

func StageDeletion

func StageDeletion(path string) error

StageDeletion adds a file deletion to the index

func StageFile

func StageFile(path string) error

StageFile adds a file to the index

func UnstageFile

func UnstageFile(path string) error

UnstageFile removes a file from the index (unstages it)

Types

This section is empty.

Jump to

Keyboard shortcuts

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