cli

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2017 License: MIT Imports: 14 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 {
	// contains filtered or unexported fields
}

Git is a cli based git backend

func Clone added in v1.6.6

func Clone(ctx context.Context, gpg, repo, path string) (*Git, error)

Clone clones an existing git repo and returns a new cli based git backend configured for this clone repo

func New

func New(path, gpg string) *Git

New creates a new git cli based git backend

func (*Git) Add

func (g *Git) Add(ctx context.Context, files ...string) error

Add adds the listed files to the git index

func (*Git) Cmd

func (g *Git) Cmd(ctx context.Context, name string, args ...string) error

Cmd runs an git command

func (*Git) Commit

func (g *Git) Commit(ctx context.Context, msg string) error

Commit creates a new git commit with the given commit message

func (*Git) ConfigGet

func (g *Git) ConfigGet(ctx context.Context, key string) (string, error)

ConfigGet returns a given config value

func (*Git) ConfigSet

func (g *Git) ConfigSet(ctx context.Context, key, value string) error

ConfigSet sets a local config value

func (*Git) HasStagedChanges

func (g *Git) HasStagedChanges(ctx context.Context) bool

HasStagedChanges returns true if there are any staged changes which can be committed

func (*Git) Init

func (g *Git) Init(ctx context.Context, signKey, userName, userEmail string) error

Init initializes this store's git repo

func (*Git) InitConfig

func (g *Git) InitConfig(ctx context.Context, signKey, userName, userEmail string) error

InitConfig initialized and preparse the git config

func (*Git) IsInitialized

func (g *Git) IsInitialized() bool

IsInitialized returns true if this stores has an (probably) initialized .git folder

func (*Git) Pull

func (g *Git) Pull(ctx context.Context, remote, branch string) error

Pull pulls from the git remote

func (*Git) Push

func (g *Git) Push(ctx context.Context, remote, branch string) error

Push pushes to the git remote

func (*Git) PushPull

func (g *Git) PushPull(ctx context.Context, op, remote, branch string) error

PushPull pushes the repo to it's origin. optional arguments: remote and branch

func (*Git) SetSignKey

func (g *Git) SetSignKey(ctx context.Context, sk string) error

SetSignKey configures git to use the given sign key

func (*Git) Version

func (g *Git) Version(ctx context.Context) semver.Version

Version returns the git version as major, minor and patch level

Jump to

Keyboard shortcuts

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