git

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GitBinary defines the name of the git client's binary on the system
	GitBinary = "git"
)

Variables

This section is empty.

Functions

func ConfigGetURLMatch

func ConfigGetURLMatch(key, url string) string

ConfigGetURLMatch call 'git config --get-urlmatch' underneath

func GetCredentials

func GetCredentials(protocol, host, username string) (string, error)

GetCredentials retrieves credentials from the built-in git-credential-store helper.

func InstallProtocol

func InstallProtocol(protocol string)

InstallProtocol configure Git to allow a given protocol on the system.

func PassThruRemoteHTTPSHelper

func PassThruRemoteHTTPSHelper(remote, url string, token string)

PassThruRemoteHTTPSHelper exec the git-remote-https helper, which allows the caller to transparently pass-thru it.

func SetConfigGlobal added in v0.2.0

func SetConfigGlobal(config *GitConfig)

SetConfigGlobal is a new signature for SetGlobalConfig

func SetGlobalConfig

func SetGlobalConfig(url, section, key, value string)

SetGlobalConfig allows to set system-wide Git configuration. The application exits in case of error.

func StoreCredentials

func StoreCredentials(protocol, host, username, password string) error

StoreCredentials persists credentials on disk, using the built-in git-credential-store helper.

Types

type GitConfig added in v0.2.0

type GitConfig struct {
	Url     string
	Section string
	Key     string
	Value   string
}

func (*GitConfig) ArgsGlobal added in v0.2.0

func (c *GitConfig) ArgsGlobal() []string

func (*GitConfig) CommandSuggestGlobal added in v0.2.0

func (c *GitConfig) CommandSuggestGlobal() string

func (*GitConfig) Name added in v0.2.0

func (c *GitConfig) Name() string

Jump to

Keyboard shortcuts

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