gitremote

package
v0.7.209 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectOrgAndRepo

func DetectOrgAndRepo(workDir string) (org, repo string, err error)

DetectOrgAndRepo runs git remote get-url origin in workDir and parses the result.

func DetectOrgAndRepoCtx added in v0.7.189

func DetectOrgAndRepoCtx(ctx context.Context, workDir string) (org, repo string, err error)

DetectOrgAndRepoCtx detects the GitHub org and repo in workDir, honouring ctx for cancellation/timeout.

func ParseRemoteURL

func ParseRemoteURL(url string) (org, repo string, err error)

ParseRemoteURL extracts org and repo from a GitHub remote URL.

func ParseRepoName added in v0.7.209

func ParseRepoName(url string) (string, error)

ParseRepoName extracts a repo name from any git remote URL by taking its last path segment and stripping a trailing .git. It handles scp style remotes (git@host:org/repo.git) as well as URLs and local paths.

func RepoName added in v0.7.209

func RepoName(ctx context.Context, workDir string) (string, error)

RepoName returns the name of the repository at workDir, read from its origin remote. Unlike DetectOrgAndRepo it accepts any host, for callers that need a name for the repository rather than its GitHub coordinates.

func URL added in v0.7.189

func URL(ctx context.Context, workDir, remote string) (string, error)

URL returns the configured URL for remote in the repository at workDir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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