git

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 5 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 CompareURL added in v0.4.4

func CompareURL(url, fromCommit, toCommit string) string

CompareURL returns a URL to view the diff between two commits. Supports GitHub and GitLab repositories.

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. Uses the GitHub/GitLab API to avoid requiring git credentials.

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