git

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(ctx context.Context, stderr io.Writer, args ...string) error

Clone clones a remote repository using the given arguments.

Types

type Repo

type Repo struct {
	Stderr io.Writer // destination for git subprocess stderr; defaults to io.Discard
	// contains filtered or unexported fields
}

Repo represents a local git repository.

func GetRepo

func GetRepo(p string) (*Repo, error)

GetRepo returns a Repo for the given local path.

func (*Repo) Add

func (r *Repo) Add(ctx context.Context, args ...string) error

Add stages the given paths.

func (*Repo) Commit

func (r *Repo) Commit(ctx context.Context, message string) error

Commit creates a commit with the given message.

func (*Repo) Pull

func (r *Repo) Pull(ctx context.Context) error

Pull fetches and merges remote changes.

func (*Repo) Push

func (r *Repo) Push(ctx context.Context) error

Push pushes to the remote, rebasing and retrying once on rejection.

func (*Repo) Rebase

func (r *Repo) Rebase(ctx context.Context) error

Rebase pulls with rebase.

func (*Repo) Remove

func (r *Repo) Remove(ctx context.Context, args ...string) error

Remove stages the deletion of the given paths. Paths that were never tracked are ignored, so callers may pass files they deleted from disk before staging was ever enabled.

Jump to

Keyboard shortcuts

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