git

package
v0.0.0-...-a1bdd4d Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(files []string, writer io.Writer) error

Add adds a list of files to the current repo with `git add <files>`.

The combined output of the command is written to the given writer.

func ApplyPatches

func ApplyPatches(paths []string, writer io.Writer) error

ApplyPatches applies a list of patches to the current repo with `git am <paths>`.

The combined output of the command is written to the given writer.

func Commit

func Commit(message string, writer io.Writer) error

Commit commits changes to the current repo with `git commit <message>`.

The combined output of the command is written to the given writer.

func FindCommitByPattern

func FindCommitByPattern(pattern string) (string, error)

FindCommitByPattern searches the git log for the provided pattern and returns the first commit hash it finds.

func FormatPatch

func FormatPatch(revisionRange, outDir string, writer io.Writer) error

FormatPatch formats a revision range as patches and writes them to the provided output directory.

The combined output of the command is written to the given writer.

func IsClean

func IsClean() (bool, error)

IsClean checks if the repo in the current directory is clean.

Untracked files are okay, but modified, added, or deleted files are not.

func SwitchToNewBranch

func SwitchToNewBranch(branch string, writer io.Writer) error

SwitchToNewBranch creates a branch in the current repo and switches to it using `git switch -c <branch>`.

The combined output of the command is written to the given writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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