git

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

git has functions for interacting with git remotes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFile

func GetFile(gitURL, commit, path string) ([]byte, error)

GetFile fetches a file from a git repository at a specific commit. Works with GitHub and GitLab repositories.

func GetLatestCommit

func GetLatestCommit(gitURL string) (string, error)

GetLatestCommit returns the latest commit hash from a git URL.

Returns the full 40-character commit hash.

func ListFiles

func ListFiles(gitURL, commit string) ([]string, error)

ListFiles returns a list of files at the root of a git repository at a specific commit. Uses the GitHub/GitLab API to list directory contents.

func ResolveCommit added in v0.4.0

func ResolveCommit(gitURL, commit string) (string, error)

ResolveCommit resolves an abbreviated commit hash to a full hash. If the commit is already a full hash (40 characters), it returns it unchanged. Uses the GitHub/GitLab API to resolve the hash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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