git

package
v0.42.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package git contains functions for interacting with git repositories.

Package git contains functions for interacting with git repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRef

func ParseRef(r string) plumbing.ReferenceName

ParseRef parses the provided ref into a ReferenceName if it's not a hash.

Types

type Repository

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

Repository manages a local git repository.

func Clone

func Clone(ctx context.Context, rootPath, address string, shallow bool) (*Repository, error)

Clone clones a git repository to the given local path.

func Open

func Open(rootPath, address string) (*Repository, error)

Open opens an existing local repository at the given path.

func (*Repository) Path

func (r *Repository) Path() string

Path returns the local path the repository is stored at.

func (*Repository) Push

func (r *Repository) Push(ctx context.Context, address, username, password string) error

Push pushes the repository to the remote git server.

Jump to

Keyboard shortcuts

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