git

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckoutBranch added in v0.3.0

func CheckoutBranch(branch string) error

CheckoutBranch will attempt to checkout the branch with the given name.

func DeleteBranches

func DeleteBranches(branches []string) error

DeleteBranches will attempt to delete branches with the given names in the current repository.

func ErrNotInRepository

func ErrNotInRepository(err error) bool

ErrNotInRepository returns true if the given error occurred because the current working directory is not part of a Git repository.

Types

type Branch

type Branch struct {
	Type        BranchType
	Name        string
	Description string
}

func Branches

func Branches() ([]*Branch, error)

Branches returns a list of Git branches in the current repository.

func NewBranch

func NewBranch(name string) (*Branch, error)

NewBranch constructs a new Branch structure based on the given branch. The branch name must match the name of a branch that exists in the current Git repository. Using the name, the function will gather information about the branch and populate the structure.

type BranchType

type BranchType int
const (
	BranchTypeNormal BranchType = iota
	BranchTypeCurrent
	BranchTypeWorktree
)

func (BranchType) String

func (bt BranchType) String() string

Jump to

Keyboard shortcuts

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