gogit

package module
v0.0.0-...-b55852a Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2017 License: MIT Imports: 9 Imported by: 3

README

gogit

GoDoc Coverage

git is a Go-library with a simple API for using git.

See the tests and documentation for more info.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRemoteOriginURL

func GetRemoteOriginURL(repoFolder string) (repo string, err error)

func ParseRepoFolder

func ParseRepoFolder(repo string) (folder string)

Types

type GitRepo

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

GitRepo is the basic store object.

func New

func New(repo string, optionalFolder ...string) (*GitRepo, error)

New returns a new GPGStore. The `repo` is the supplied git repository. Optionally you can include a string for which folder to save the repo to. The default location is the current directory.

func (*GitRepo) AddData

func (gr *GitRepo) AddData(data []byte, fp string) (err error)

AddData will write the `data` to a new file, `fp` in the repo and then perform a commit with the message of that files name. Note that the filename should be respective to the root of the repository.

func (*GitRepo) Debug

func (gr *GitRepo) Debug(on bool)

Debug will allow verbose output if enabled.

func (*GitRepo) Push

func (gr *GitRepo) Push() (err error)

Push will push the repo to the master branch.

func (*GitRepo) Update

func (gr *GitRepo) Update() (err error)

Update will clone a repo if it doesn't exist or pull a repo, if it does.

Jump to

Keyboard shortcuts

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