git

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckoutGitBranch

func CheckoutGitBranch(repoPath, branchName string) error

CheckoutGitBranch switches the repository at repoPath to the branch specified by branchName.

func CloneRepoToTemp added in v1.2.0

func CloneRepoToTemp(repoURL string) (string, error)

CloneRepoToTemp clones the given GitHub repository URL (https:// or ssh:// or git@...) into a newly-created temporary directory under /tmp and returns the local path.

func GetCurrentBranch

func GetCurrentBranch(path string) (string, error)

GetCurrentBranch returns the head ref of a Git Repository

func IsGitRepo

func IsGitRepo(path string) bool

IsGitRepo detects if a given repository is Git initialized

func ListGitBranches

func ListGitBranches(repoPath string) ([]string, error)

ListGitBranches opens the Git repository located at repoPath and returns a slice of branch names found in the repository.

func ListTags

func ListTags(repo *git.Repository) ([]string, error)

ListTags lists all tags available for a given repository

Types

This section is empty.

Jump to

Keyboard shortcuts

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