Help us shape the future of Go! Take the 2026 Go Developer Survey

git

package
v0.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package git provides small helpers for interacting with the local git repository — detecting the Bitbucket workspace/repo from the origin remote, reading the current branch, and running git commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checkout

func Checkout(branch string) error

Checkout checks out the given branch.

func CurrentBranch

func CurrentBranch() (string, error)

CurrentBranch returns the name of the currently checked-out branch.

func DetectRepo

func DetectRepo() (workspace, repoSlug string, err error)

DetectRepo returns the Bitbucket workspace and repo slug for the current directory by inspecting the origin remote.

func Fetch

func Fetch(remote, ref string) error

Fetch fetches a ref from the given remote.

func ParseRemoteURL

func ParseRemoteURL(remote string) (workspace, repoSlug string, err error)

ParseRemoteURL extracts the workspace and repo slug from a Bitbucket remote URL (SSH, HTTPS, or ssh:// form).

func ValidateCloneURL

func ValidateCloneURL(raw string) error

ValidateCloneURL accepts only Bitbucket Cloud's HTTPS and SSH clone URLs. Reject Git options, local paths and remote-helper protocols before invoking Git.

Types

This section is empty.

Jump to

Keyboard shortcuts

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