git

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGitRepository

func IsGitRepository(path string) bool

IsGitRepository checks if a path is a git repository

Types

type Repository

type Repository struct {
	Path string
	Name string
}

Repository represents a git repository

func NewRepository

func NewRepository(path, name string) *Repository

NewRepository creates a new Repository instance

func (*Repository) Fetch added in v1.2.0

func (r *Repository) Fetch() error

Fetch runs git fetch to update remote tracking branches

func (*Repository) GetStatus

func (r *Repository) GetStatus() (*Status, error)

GetStatus retrieves the git status of a repository

func (*Repository) SetUpstream

func (r *Repository) SetUpstream() error

SetUpstream configures and pushes to set upstream tracking

type Status

type Status struct {
	Type    StatusType
	Message string
	Symbol  string
}

Status represents the git status of a repository

type StatusType

type StatusType string

StatusType represents the type of git status

const (
	StatusSync       StatusType = "sync"
	StatusUnsync     StatusType = "unsync"
	StatusError      StatusType = "error"
	StatusIgnored    StatusType = "ignored"
	StatusNoUpstream StatusType = "no_upstream"
)

Jump to

Keyboard shortcuts

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