git

package
v0.0.0-...-3b5879d Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 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 Git

type Git struct {
	SSHKey     string
	LocalPath  string
	RemotePath string
	BranchName string
	Repository *gogit.Repository
	GitToken   string
	GitUser    string
}

Git represents repository object and wraps go-git calls

func Client

func Client() *Git

Client initializes a git repo under a temp directory and attaches a remote

func EnvGitClient

func EnvGitClient(repo string, branch string, namespace string, env string) (*Git, error)

EnvGitClient is git client for environment

func (*Git) Pull

func (g *Git) Pull() error

Pull performs git pull for remote path

func (*Git) Refresh

func (g *Git) Refresh() error

Refresh checks if local git repository copy is outdated. If it is, changes are pulled in.

func (*Git) UpdatesExist

func (g *Git) UpdatesExist() (bool, error)

UpdatesExist returns true if local HEAD is behind remote

Jump to

Keyboard shortcuts

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