git

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package git provides git operations helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checkout

func Checkout(repoPath, ref string) error

Checkout checks out a specific tag or branch

func Clone

func Clone(url, dest string) error

Clone clones a git repository to the specified destination

func GetCurrentCommit added in v0.2.0

func GetCurrentCommit(repoPath string) (string, error)

GetCurrentCommit returns the current commit hash of the repository

func GetLatestTag

func GetLatestTag(repoPath string) (string, error)

GetLatestTag returns the latest tag for a repository in the given path

func InstallSubdir

func InstallSubdir(repoURL, branch, subDir, dest string) error

InstallSubdir installs a subdirectory from a repository Uses sparse checkout for efficiency, falls back to full clone if sparse fails

func SparseClone added in v0.2.0

func SparseClone(repoURL, branch, subDir, dest string) error

SparseClone clones only a specific subdirectory using sparse checkout This is much faster than full clone for large repos when only a subdir is needed

Types

This section is empty.

Jump to

Keyboard shortcuts

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