git

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package git wraps internal/run.Runner to provide git-specific operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

type Git struct {
	// contains filtered or unexported fields
}

Git provides git operations via the Runner.

func New

func New(runner run.Runner) *Git

New constructs a Git wrapper around the given Runner.

func (*Git) Checkout

func (g *Git) Checkout(branch string) error

Checkout checks out a branch.

func (*Git) Clone

func (g *Git) Clone(url, dir string) error

Clone clones a repo URL into dir (empty string = default dir).

func (*Git) CommitsAhead

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

CommitsAhead returns number of commits in current branch ahead of base.

func (*Git) CurrentBranch

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

CurrentBranch returns the name of the current branch.

func (*Git) Fetch

func (g *Git) Fetch(remote, branch string) error

Fetch fetches a branch from remote.

func (*Git) HasUncommittedChanges

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

HasUncommittedChanges returns true if the working tree is dirty.

func (*Git) RemoteURL

func (g *Git) RemoteURL(name string) (string, error)

RemoteURL returns the URL for the named remote.

Jump to

Keyboard shortcuts

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