Version: v1.6.11 Latest Latest

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

Go to latest
Published: Feb 20, 2018 License: MIT Imports: 15 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Git

type Git struct {
	// contains filtered or unexported fields

Git is a cli based git backend

func Clone

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 Init

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

Init initializes this store's git repo

func Open

func Open(path, gpg string) (*Git, error)

Open 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) AddRemote

func (g *Git) AddRemote(ctx context.Context, remote, url string) error

AddRemote adds a new remote

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) 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

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL