cmdgit

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

type Git struct {
	Directory  string // The (temporary) directory that should be worked within
	FetchDepth int    // Limit fetching to the specified number of commits
}

Git is an implementation of git that executes git as commands

func (*Git) AddRemote

func (g *Git) AddRemote(name, url string) error

AddRemote adds a new remote

func (*Git) BranchExist

func (g *Git) BranchExist(remoteName, branchName string) (bool, error)

BranchExist checks if the new branch exists

func (*Git) ChangeBranch

func (g *Git) ChangeBranch(branchName string) error

ChangeBranch changes the branch

func (*Git) Changes

func (g *Git) Changes() (bool, error)

Changes detect if any changes has been made in the directory

func (*Git) Clone

func (g *Git) Clone(ctx context.Context, url string, baseName string) error

Clone a repository

func (*Git) Commit

func (g *Git) Commit(commitAuthor *git.CommitAuthor, commitMessage string) error

Commit and push all changes

func (*Git) Push

func (g *Git) Push(ctx context.Context, remoteName string, force bool) error

Push the committed changes to the remote

Jump to

Keyboard shortcuts

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