git

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(gitURL, targetDir, branch, tag string, depth int) error

Clone clones a git repository to the target directory. If branch is non-empty, it checks out that branch. If tag is non-empty, it checks out that tag. If depth > 0, a shallow clone is performed. Progress output goes to stderr.

func ClonePath

func ClonePath(gitURL string) (string, error)

ClonePath returns the local directory path where a git workspace should be cloned. Follows Go module conventions: ~/.cache/flow/git-workspaces/<host>/<path>

func EnsureInstalled

func EnsureInstalled() error

EnsureInstalled checks that the git binary is available on PATH.

func IsGitURL

func IsGitURL(s string) bool

IsGitURL returns true if the given string looks like a Git remote URL (HTTPS or SSH).

func Pull

func Pull(repoDir, ref, refType string) error

Pull fetches and pulls the latest changes for a git repository. If the workspace was cloned with a specific branch, it pulls that branch. If it was cloned with a tag, it fetches tags and checks out the tag.

func ResetPull

func ResetPull(repoDir, ref, refType string) error

ResetPull performs a force update by resetting the working tree to match the remote. For branches, it fetches and does a hard reset to the remote tracking branch. For tags, it fetches tags and checks out the specified tag, discarding local changes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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