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: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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