git

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRootDir

func GetRootDir() (string, error)

GetRootDir returns the root directory of the git repository

func IsGitRepository

func IsGitRepository(dir string) bool

IsGitRepository returns true if the directory is a Git repository

Types

type Repository

type Repository struct {
	Repository *git.Repository
}

Repository repo handle

func NewRepository

func NewRepository(dir string) (*Repository, error)

NewRepository returns the repository handle

func (*Repository) CreateAnnotatedTag added in v1.2.0

func (r *Repository) CreateAnnotatedTag(tag, message string) error

CreateAnnotatedTag creates an annotated tag

func (*Repository) CreateLightweightTag added in v1.2.0

func (r *Repository) CreateLightweightTag(tag string) error

CreateLightweightTag creates an lightweight tag

func (*Repository) GetTags

func (r *Repository) GetTags() []string

GetTags returns a list of git tags

func (*Repository) HasUncommitedChanges added in v1.4.0

func (r *Repository) HasUncommitedChanges() bool

HasUncommitedChanges returns true if the git index is clean

func (*Repository) PushTags

func (r *Repository) PushTags(remote string) error

PushTags pushes to the specified remotre

Jump to

Keyboard shortcuts

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