Help us shape the future of Go! Take the 2026 Go Developer Survey

git

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//LogFunc can be overrided
	LogFunc = log.Printf
)

Functions

func Clone

func Clone(repo, workdirPath, path string, auth *AuthOpts, opts *CloneOpts, output *OutputOpts) (string, error)

Clone make a git clone

func Push

func Push(repo string, auth *AuthOpts, opts *PushOpts, output *OutputOpts) error

Push make git push action

func TagCreate

func TagCreate(repo string, auth *AuthOpts, opts *TagOpts, output *OutputOpts) error

TagCreate makes git tag action

func TagList

func TagList(repo, workdirPath, dir string, auth *AuthOpts, output *OutputOpts) error

TagList List tag from given git directory

Types

type AuthOpts

type AuthOpts struct {
	Username   string
	Password   string
	PrivateKey vcs.SSHKey
	SignKey    vcs.PGPKey
}

AuthOpts is a optional structs for git command

type CloneOpts

type CloneOpts struct {
	Depth                   int
	SingleBranch            bool
	Branch                  string
	Tag                     string
	Recursive               bool
	Verbose                 bool
	Quiet                   bool
	CheckoutCommit          string
	NoStrictHostKeyChecking bool
	ForceGetGitDescribe     bool
}

CloneOpts is a optional structs for git clone command

type Info

type Info struct {
	GitDescribe string
	Hash        string // git Hash
	Message     string
	Author      string
	AuthorEmail string
	Branch      string
}

Info contains some Information about a git repository

func ExtractInfo

func ExtractInfo(ctx context.Context, dir string, opts *CloneOpts) (Info, error)

ExtractInfo returns an info, containing git information (git.Hash, describe) ignore error if a command fails (example: for empty repository)

type OutputOpts

type OutputOpts struct {
	Stdout io.Writer
	Stderr io.Writer
}

OutputOpts is a optional structs for git clone command

type PushOpts

type PushOpts struct {
	Directory string
	Remote    string
	Branch    string
}

PushOpts represents options for git push command

type TagOpts

type TagOpts struct {
	Message  string
	SignKey  string
	SignID   string
	Name     string
	Path     string
	Username string
}

TagOpts represents options for git tag command

Jump to

Keyboard shortcuts

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