git

package
v1.135.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 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

func (*Git) Clone

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

func (*Git) CommitsAhead

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

func (*Git) CurrentBranch

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

func (*Git) Fetch

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

func (*Git) GetConfig added in v1.8.0

func (g *Git) GetConfig(key string) (string, error)

GetConfig reads a value from the local repository's git config. A missing key returns ("", nil) — git config exits non-zero in that case but callers should treat absence as "fall back to other inference" rather than as an error condition.

func (*Git) HasUncommittedChanges

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

func (*Git) RemoteURL

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

func (*Git) SetConfig added in v1.8.0

func (g *Git) SetConfig(key, value string) error

SetConfig writes a key-value pair to the local repository's git config. Used by `repo set-default` to pin a chosen Bitbucket coordinate so future commands in this checkout do not consult the git remote.

func (*Git) SetConfigInDir added in v1.116.0

func (g *Git) SetConfigInDir(dir, key, value string) error

SetConfigInDir writes a key-value pair to the git config of a specific repo dir.

Jump to

Keyboard shortcuts

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