git

package
v0.44.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package git provides a very basic wrapper around git. Using git2go would be better but requires libgit2 to be installed This assumes git, however, is available.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

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

Git holds the necessary information to make commits.

func New

func New(root, user, email string) (*Git, error)

New Git struct.

func (*Git) Add

func (g *Git) Add(files ...string) error

Add files to commit.

func (*Git) AddRemote

func (g *Git) AddRemote(remoteName, remoteURL string) error

AddRemote to the git repository.

func (*Git) Commit

func (g *Git) Commit(message string) error

Commit previously added files.

func (*Git) Compress

func (g *Git) Compress() error

Compress the git repository.

func (*Git) Exists

func (g *Git) Exists() bool

Exists checks if this is a true git repository.

func (*Git) HasRemote

func (g *Git) HasRemote(remote string) bool

HasRemote checks if the repository has a specific remote.

func (*Git) Init

func (g *Git) Init() error

Init a new git repository.

func (*Git) Push

func (g *Git) Push(remoteName, remoteURL, remoteUser, remotePassword string) error

Push to a registered git remote.

Jump to

Keyboard shortcuts

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