git

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ConfirmNo = "No"
View Source
const ConfirmYes = "Yes"

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	Name    string
	Current bool
}

type Branches

type Branches []Branch

func (Branches) ExcludeCurrent

func (branches Branches) ExcludeCurrent() Branches

func (Branches) Filter

func (branches Branches) Filter(f branchFilterFunc) Branches

func (Branches) GetCurrent

func (branches Branches) GetCurrent() *Branch

func (Branches) Names

func (branches Branches) Names() []string

func (Branches) StrictSearch

func (branches Branches) StrictSearch(search string) Branches

type CheckoutDTO

type CheckoutDTO struct {
	Name        string
	AllProjects bool
	Workspace   string
	Project     string
	Pull        bool
	Rebase      bool
	Create      bool
}

type Git

type Git struct {
	// contains filtered or unexported fields
}

func NewGit

func NewGit(exec executor, tui tui, contextResolver contextResolver) *Git

func (*Git) Checkout

func (g *Git) Checkout(dto CheckoutDTO) error

func (*Git) Clone

func (g *Git) Clone(repoURL string, target string, dir string) error

func (*Git) DirectoryHasOrigin

func (g *Git) DirectoryHasOrigin(dir string, origin string) (bool, error)

func (*Git) GetCurrentBranch

func (g *Git) GetCurrentBranch(dir string) (string, error)

func (*Git) GetRepositoryRootFromPath

func (g *Git) GetRepositoryRootFromPath(path string) (string, error)

func (*Git) Logl

func (g *Git) Logl(dto LoglDTO) error

func (*Git) Pull added in v0.15.0

func (g *Git) Pull(dto PullDTO) error

func (*Git) PullBranch

func (g *Git) PullBranch(dto PullBranchDTO) error

func (*Git) Push

func (g *Git) Push(dto PushDTO) error

func (*Git) PushBranch added in v0.15.0

func (g *Git) PushBranch(dto PushBranchDTO) error

func (*Git) RebaseInteractively

func (g *Git) RebaseInteractively(dto RebaseInteractivelyDTO) error

func (*Git) ShowBranches

func (g *Git) ShowBranches(dto SearchBranchesDTO) error

func (*Git) Status added in v0.15.0

func (g *Git) Status(dto StatusDTO) error

func (*Git) UndoLastXCommits

func (g *Git) UndoLastXCommits(dto UndoLastXCommitsDTO) error

type LoglDTO

type LoglDTO struct {
	// The amount of commits to show
	Amount int
	// The directory to run the command in, defaults to the current directory
	Dir string
}

type PullBranchDTO

type PullBranchDTO struct {
	// The directory to run the command in, defaults to the current directory
	Dir string
	// Passes --rebase to git pull
	Rebase bool
}

type PullDTO added in v0.15.0

type PullDTO struct {
	AllProjects bool
	Workspace   string
	Project     string
	Rebase      bool
}

type PushBranchDTO added in v0.15.0

type PushBranchDTO struct {
	Force bool
	// The directory to run the command in, defaults to the current directory
	Dir string
}

type PushDTO

type PushDTO struct {
	AllProjects bool
	Workspace   string
	Project     string
	Force       bool
}

type RebaseInteractivelyDTO

type RebaseInteractivelyDTO struct {
	// The amount of commits to include in the rebase
	Amount int
	// The directory to run the command in, defaults to the current directory
	Dir string
}

type SearchBranchesDTO

type SearchBranchesDTO struct {
	Search string
	// The directory to run the command in, defaults to the current directory
	Dir string
}

type StatusDTO added in v0.15.0

type StatusDTO struct {
	AllProjects bool
	Workspace   string
	Project     string
}

type UndoLastXCommitsDTO

type UndoLastXCommitsDTO struct {
	// The amount of commits to remoe
	Amount           int
	SkipConfirmation bool
	// The directory to run the command in, defaults to the current directory
	Dir string
}

Jump to

Keyboard shortcuts

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