git

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 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 BranchTracking added in v1.2.5

type BranchTracking struct {
	Branch  string
	Message string
}

BranchTracking represents the tracking status of a branch

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) GetBranchesTrackingStatus added in v1.2.5

func (r *Repository) GetBranchesTrackingStatus() ([]BranchTracking, error)

GetBranchesTrackingStatus checks all local branches and returns those that are behind their remote

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
	BehindBranches []BranchTracking // Branches that are behind their remote
}

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