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

gogit

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2019 License: AGPL-3.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Origin represents the constant for 'origin' remote
	Origin = "origin"

	// Master is the constant for master branch
	Master = "master"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// RepositoryRoot represents the root of the git repository after cloning
	RepositoryRoot string

	// GitPath represents the path to the git executable
	GitPath string
}

Info represents the repository information

type Repository

type Repository interface {
	Validate() error

	// GetInfo retrieves the information of this git repository like path, indices etc.
	GetInfo() *Info

	// Checkout checks out a branch in the git repository
	Checkout(branchName string) error

	// CreateAndCheckout creates and checks out a branch
	CreateAndCheckout(branchName string) error

	// ListRemoteBranches lists all the remote branches with the given remote name
	ListRemoteBranches(remoteName string) ([]string, error)

	// PushAndSetUpstream pushes and sets up the upstream branch from the current branch
	PushAndSetUpstream(remoteName string, branchName string) error
}

Repository represents a git repository

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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