git

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitbucketContext

type BitbucketContext struct {
	ServerURL  string // e.g. "https://bitbucket.example.com"
	ProjectKey string // e.g. "PRJ"
	RepoSlug   string // e.g. "my-repo"
}

BitbucketContext holds the server and repo identity derived from a git remote URL.

func ContextFromCWD

func ContextFromCWD() (*BitbucketContext, error)

ContextFromCWD opens the git repository rooted at (or containing) the current working directory and extracts a BitbucketContext from the "origin" remote. Returns an error if no git repo is found or the remote URL cannot be parsed.

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(token string) *Service

func (*Service) Clone

func (s *Service) Clone(ctx context.Context, repository *bitbucketclient.RestRepository, targetDir string) error

Clone clones a repository into targetDir.

func (*Service) GetRemotes

func (s *Service) GetRemotes(path string) (map[string][]string, error)

GetRemotes returns the remotes of the git repository at path.

func (*Service) PushBranch

func (s *Service) PushBranch(ctx context.Context, branchName string) error

PushBranch pushes the named branch from the git repository at the current working directory to its origin remote.

Jump to

Keyboard shortcuts

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