gitw

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchesWithRemotes

func BranchesWithRemotes() (map[string]string, error)

BranchesWithRemotes uses the Git config to determine which branches also exist on the remotes. Returns a list of branches.

func CurrentBranch

func CurrentBranch() string

CurrentBranch gets the current local branch.

func DefaultBranch

func DefaultBranch(remote string) (string, error)

DefaultBranch gets the default branch (like main) from the remote refs.

func HasFile

func HasFile(segments ...string) bool

func IsGitDir

func IsGitDir() bool

IsGitDir checks if the current working directory containers a .git folder.

func LocalBranches

func LocalBranches() ([]string, error)

LocalBranches gets a list of all local branches as a slice of strings.

func RemoteFromHead added in v0.2.0

func RemoteFromHead() (string, error)

RemoteFromHead gets the remote where the HEAD is.

Types

type Range

type Range struct {
	A string
	B string
}

func NewRange

func NewRange(a, b string) (*Range, error)

func (*Range) IsAncestor

func (r *Range) IsAncestor() bool

func (*Range) IsIdentical

func (r *Range) IsIdentical() bool

Jump to

Keyboard shortcuts

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