git

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DryRun flag
	DryRun bool

	// Force ignores dirty repo
	Force bool

	// Quiet flag
	Quiet bool

	// Verbose level
	Verbose int

	// GitBin path
	GitBin = "git"

	// Stdout writer
	Stdout io.Writer = os.Stdout
	// Stderr writer
	Stderr io.Writer = os.Stderr
	// Stdin reader
	Stdin io.Reader = os.Stdin
)
View Source
var (
	// Scheme git, https or ssh
	Scheme = "https"

	// Host git
	Host = "github.com"

	// User git
	User *url.Userinfo // = url.User("git")

)

Functions

func CheckRemote

func CheckRemote(dir, url string) error

CheckRemote URL of an existing repository

func ParseURL

func ParseURL(u *url.URL, repo string) (*url.URL, error)

ParseURL ...

Types

type Repo

type Repo struct {
	Dir string
	URL *url.URL
	// contains filtered or unexported fields
}

Repo ...

func NewRepo

func NewRepo(u *url.URL, repo, dir string) (*Repo, error)

NewRepo git

func (*Repo) Clone

func (r *Repo) Clone() (string, error)

Clone repo

func (*Repo) Exec

func (r *Repo) Exec(args ...string) (string, string, error)

Exec git command

func (*Repo) ExecCombined

func (r *Repo) ExecCombined(args ...string) (string, error)

ExecCombined git command

func (*Repo) GetURL

func (r *Repo) GetURL() string

GetURL transforms ssh://user@host/path into user@host:path

func (*Repo) Pull

func (r *Repo) Pull() (string, error)

Pull repo

func (*Repo) Status

func (r *Repo) Status() (string, error)

Status repo

type Version

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

Version semantic

func (*Version) String

func (v *Version) String() string

Jump to

Keyboard shortcuts

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