git

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitStateClean = 1 << iota
	GitStateUntracked
	GitStateDirty
)

Variables

View Source
var ErrNotGitRepo = fmt.Errorf("provided directory is not a git repository")

Functions

func Commit

func Commit(dir, msg string, args ...string) error

func Push

func Push(dir string, args ...string) error

func RemoteSetURL

func RemoteSetURL(dir, name, url string, args ...string) error

Types

type GitState

type GitState uint8

type Remote

type Remote struct {
	Name string
	URL  string
	Kind RemoteKind
}

func RemoteList

func RemoteList(dir string) ([]Remote, error)

type RemoteKind

type RemoteKind uint8
const (
	RemoteKindPush RemoteKind = 1 << iota
	RemotekindFetch
)

type StatusResult

type StatusResult struct {
	State     GitState
	Untracked []string
	Modified  []string
}

func Status

func Status(dir string, ignoreUntracked bool, args ...string) (StatusResult, error)

Jump to

Keyboard shortcuts

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