git

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchCommit

func BranchCommit(path, branch string) (string, error)

func CheckoutBranch

func CheckoutBranch(path, branch string) error

func CommonDir

func CommonDir(path string) (string, error)

CommonDir returns the repository's shared Git directory.

func CurrentBranch

func CurrentBranch(path string) (string, error)

func DefaultBranch

func DefaultBranch(path string) (string, error)

func HasAlternates

func HasAlternates(path string) (bool, error)

func HasUncommittedChanges

func HasUncommittedChanges(path string) (bool, error)

func HeadCommit

func HeadCommit(path string) (string, error)

func IsBare

func IsBare(path string) (bool, error)

func IsDetachedHead

func IsDetachedHead(path string) (bool, error)

IsDetachedHead reports whether HEAD names a commit directly rather than through a branch: unlike CurrentBranch, unreadable and detached do not collapse into one error - symbolic-ref must find no branch while HEAD still resolves to a real commit (atqamz/hand#428).

func LocalDefaultBranch

func LocalDefaultBranch(path string) (string, error)

func LocalDefaultBranchRef

func LocalDefaultBranchRef(path string) (string, error)

func PreserveDefaultBranch

func PreserveDefaultBranch(path, branch string) error

func RemoveOrigin

func RemoveOrigin(path string) error

func ResolveRoot

func ResolveRoot(path string) (string, error)

func Run

func Run(dir string, args ...string) (string, error)

func SamePath

func SamePath(left, right string) bool

SamePath reports whether two paths identify the same filesystem location.

Types

This section is empty.

Jump to

Keyboard shortcuts

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