git

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	GitHubProvider    = "github"
	GitLabProvider    = "gitlab"
	BitBucketProvider = "bitbucket-cloud"
)

Variables

Functions

func CreateWebHook added in v0.38.0

func CreateWebHook(ctx context.Context, gitRepoURL, webHookTarget, webHookSecret, personalAccessToken string) error

func GitProviderName

func GitProviderName(url string) (string, error)

func RepoOwnerAndNameFromUrl

func RepoOwnerAndNameFromUrl(url string) (string, string, error)

RepoOwnerAndNameFromUrl for input url returns repo owner and repo name eg. for github.com/foo/bar returns 'foo' and 'bar'

func ResolveBranch added in v0.50.0

func ResolveBranch(repoPath string) string

ResolveBranch returns the current branch name for the repository at the given path. Returns "main" if the branch cannot be determined (not a git repo, detached HEAD, etc.).

func ResolveRemoteURL added in v0.50.0

func ResolveRemoteURL(repoPath string) (string, error)

ResolveRemoteURL detects the git remote URL for the repository at the given path. It prefers the current branch's tracking remote, falling back to "origin". Returns an empty string if no remote can be determined (not a git repo, no remotes configured, etc.). The URL is returned as-is (SSH or HTTPS).

Types

type SupportedProviders

type SupportedProviders []string

func (SupportedProviders) PrettyString

func (sp SupportedProviders) PrettyString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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