git

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

type Git struct {
	Dir     string
	Verbose bool
}

func (*Git) BareRepoDir

func (g *Git) BareRepoDir() (string, error)

func (*Git) CommitsAhead added in v1.0.0

func (g *Git) CommitsAhead(base string) (int, error)

CommitsAhead returns the number of commits HEAD is ahead of base.

func (*Git) DefaultBranch

func (g *Git) DefaultBranch() (string, error)

func (*Git) HasUnpushedCommits

func (g *Git) HasUnpushedCommits() (bool, error)

func (*Git) IsDirty

func (g *Git) IsDirty() (bool, error)

func (*Git) IsRebaseInProgress added in v1.0.0

func (g *Git) IsRebaseInProgress() bool

IsRebaseInProgress checks if a rebase is currently in progress.

func (*Git) LocalBranchExists added in v1.0.0

func (g *Git) LocalBranchExists(branch string) bool

LocalBranchExists checks if a local branch exists in the repo.

func (*Git) MergedBranches added in v0.7.0

func (g *Git) MergedBranches(base string) ([]string, error)

MergedBranches returns branches that have been merged into origin/<base>.

func (*Git) Rebase added in v1.0.0

func (g *Git) Rebase(onto string) error

Rebase runs git rebase <onto> in the current directory.

func (*Git) RebaseAbort added in v1.0.0

func (g *Git) RebaseAbort() error

RebaseAbort aborts an in-progress rebase.

func (*Git) RemoteBranchExists added in v1.0.0

func (g *Git) RemoteBranchExists(branch string) bool

RemoteBranchExists checks if a branch exists on origin.

func (*Git) RemoteBranches added in v1.0.0

func (g *Git) RemoteBranches() ([]string, error)

RemoteBranches returns remote branch names from origin, stripping the "origin/" prefix. The HEAD pointer is excluded.

func (*Git) Run

func (g *Git) Run(args ...string) (string, error)

func (*Git) RunStream added in v0.6.2

func (g *Git) RunStream(stderr io.Writer, args ...string) (string, error)

RunStream captures stdout and returns it, while streaming stderr to the given writer in real-time. Useful for commands like `git fetch --progress` where progress output goes to stderr.

func (*Git) WorktreeRoot

func (g *Git) WorktreeRoot() (string, error)

Jump to

Keyboard shortcuts

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