git

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(repo Repository) *execabs.Cmd

Add updates the index to match the working tree.

func CheckoutHead

func CheckoutHead(repo Repository) *execabs.Cmd

CheckoutHead handles branch checkout.

func ConfigAutocorrect

func ConfigAutocorrect(repo Repository) *execabs.Cmd

repoUserEmail sets the global git author email.

func ConfigSSLVerify

func ConfigSSLVerify(repo Repository) *execabs.Cmd

repoSSLVerify disables globally the git ssl verification.

func ConfigUserEmail

func ConfigUserEmail(repo Repository) *execabs.Cmd

repoUserEmail sets the global git author email.

func ConfigUserName

func ConfigUserName(repo Repository) *execabs.Cmd

repoUserName sets the global git author name.

func EmptyCommit

func EmptyCommit(repo Repository) *execabs.Cmd

EmptyCommit simply create an empty commit.

func FetchSource

func FetchSource(repo Repository) *execabs.Cmd

FetchSource fetches the source from remote.

func ForceAdd

func ForceAdd(repo Repository) *execabs.Cmd

ForceAdd forces the addition of all dirty files.

func ForceCommit

func ForceCommit(repo Repository) *execabs.Cmd

ForceCommit commits every change while skipping CI.

func Init

func Init(repo Repository) *execabs.Cmd

RemoteRemove drops the defined remote from a git repo.

func IsDirty

func IsDirty(repo Repository) bool

func RemoteAdd

func RemoteAdd(repo Repository) *execabs.Cmd

RemoteAdd adds an additional remote to a git repo.

func RemotePush

func RemotePush(repo Repository) *execabs.Cmd

RemotePush pushs the changes from the local head to a remote branch.

func RemoteRemove

func RemoteRemove(repo Repository) *execabs.Cmd

RemoteRemove drops the defined remote from a git repo.

func Status

func Status(repo Repository) *execabs.Cmd

func TestCleanTree

func TestCleanTree(repo Repository) *execabs.Cmd

TestCleanTree returns non-zero if diff between index and local repository.

func WriteNetrc

func WriteNetrc(machine, login, password string) error

WriteNetrc writes the netrc file.

func WriteSSHKey

func WriteSSHKey(privateKey string) error

WriteKey writes the SSH private key.

Types

type Author

type Author struct {
	Name  string
	Email string
}

type Repository

type Repository struct {
	RemoteName string
	RemoteURL  string
	Branch     string

	Add       string
	CommitMsg string

	Autocorrect       string
	NoVerify          bool
	InsecureSSLVerify bool
	EmptyCommit       bool
	PushFollowTags    bool
	ForcePush         bool
	SSLVerify         bool
	WorkDir           string
	InitExists        bool

	Author Author
}

Jump to

Keyboard shortcuts

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