git

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentBranchName added in v0.0.4

func CurrentBranchName(globalOptions ...GlobalOptions) (string, error)

CurrentBranchName returns the name of the current branch

func Fetch

func Fetch(remote string, branch string, globalOptions ...GlobalOptions) error

Fetch fetches the specified branch from the specified remote for the repository in the current working directory

func IsBehindRemote added in v0.0.3

func IsBehindRemote(remote string, branch string, globalOptions ...GlobalOptions) (bool, error)

IsBehindRemote returns true if the specified branch is behind the specified remote for the repository in the current working directory.

Types

type GlobalOptions added in v0.0.6

type GlobalOptions struct {
	// AsIfIn directs git to operate as if it were run from the specified directory instead of the
	// current working directory.  i.e. the -C <path> option to the git CLI.
	AsIfIn string

	// Log directs the code in this package to log its actions.  It is not passed the git CLI.
	Log bool

	// GitDir is the path to the .git directory or its parent directory.
	// i.e. a repository working directory that contains a .git directory may be provided instead
	// of the .git directory.
	GitDir string
}

GlobalOptions are options that apply to all git CLI commands. An instance of GlobalOptions may optionally be passed to each git command as the final argument.

Jump to

Keyboard shortcuts

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