git

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GithubRepoURL

func GithubRepoURL(oauthToken, organization, repository string) string

GithubRepoURL returns a HTTPS url to acces the github repository with OAUTH authentication

Types

type Repository

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

Repository represents a git repository

func NewGithubRepository

func NewGithubRepository(oauthToken, organization, repository, localdirectory string) *Repository

NewGithubRepository initializes a github based repository object

func (*Repository) Clone

func (r *Repository) Clone(branch string) error

Clone clones the git repository, the directory must not exist

func (*Repository) CreateBranch

func (r *Repository) CreateBranch(branch string) error

CreateBranch creates a new branch

func (*Repository) CreateCommit

func (r *Repository) CreateCommit(msg string, files []string) error

CreateCommit creates a commit

func (*Repository) FileChanged

func (r *Repository) FileChanged(relpath string) (bool, error)

FileChanged returns true if the tracked filed contains non-committed changes

func (*Repository) Push

func (r *Repository) Push() error

Push pushes the branch to the default remote

func (*Repository) UpClone

func (r *Repository) UpClone(branch string) error

UpClone clones the repository if the directory does not exist yet otherwise updates it.

func (*Repository) Update

func (r *Repository) Update(branch string) error

Update checksout the branch and updates it to the newest remote ref

Jump to

Keyboard shortcuts

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