git

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 2 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

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

Git represents a Git project.

func New

func New(dir string) (Git, error)

New creates a new git project.

func (*Git) Add

func (g *Git) Add(pathspec string) *command.Model

Add file contents to the index. Pathspec is the list of files to add content from. Fileglobs (e.g. *.c) can be given to add all matching files.

func (*Git) Apply

func (g *Git) Apply(patch string) *command.Model

Apply reads the supplied diff output (patch) and applies it to files.

func (*Git) Branch

func (g *Git) Branch(opts ...string) *command.Model

Branch lists branches.

func (*Git) Checkout

func (g *Git) Checkout(arg string) *command.Model

Checkout switches branches or restore working tree files. Arg can be a commit hash, a branch or a tag.

func (*Git) Clean

func (g *Git) Clean(options ...string) *command.Model

Clean removes untracked files from the working tree.

func (*Git) Clone

func (g *Git) Clone(repo string, opts ...string) *command.Model

Clone a repository into a new directory.

func (*Git) CloneTagOrBranch

func (g *Git) CloneTagOrBranch(repo, tagOrBranch string, opts ...string) *command.Model

CloneTagOrBranch is recursively clones a tag or branch.

func (*Git) Commit

func (g *Git) Commit(message string) *command.Model

Commit Stores the current contents of the index in a new commit along with a log message from the user describing the changes.

func (*Git) Config

func (g *Git) Config(key string, value string, opts ...string) *command.Model

Config sets a git config setting for the repository.

func (*Git) Fetch

func (g *Git) Fetch(opts ...string) *command.Model

Fetch downloads objects and refs from another repository.

func (*Git) Init

func (g *Git) Init() *command.Model

Init creates an empty Git reporitory or reinitializes an existing one.

func (*Git) Log

func (g *Git) Log(format string, opts ...string) *command.Model

Log shows the commit logs. The format parameter controls what is shown and how. Revision range can be optionally specified using the opts parameter.

func (*Git) Merge

func (g *Git) Merge(arg string) *command.Model

Merge joins two or more development histories together. Arg can be a commit hash, branch or tag.

func (*Git) NewBranch

func (g *Git) NewBranch(branch string) *command.Model

NewBranch creates a new branch as if git-branch were called and then check it out.

func (*Git) Pull

func (g *Git) Pull() *command.Model

Pull incorporates changes from a remote repository into the current branch.

func (*Git) Push

func (g *Git) Push(branch string) *command.Model

Push updates remote refs along with associated objects.

func (*Git) RemoteAdd

func (g *Git) RemoteAdd(name, url string) *command.Model

RemoteAdd adds a remote named <name> for the repository at <url>.

func (*Git) RemoteList

func (g *Git) RemoteList() *command.Model

RemoteList shows a list of existing remote urls with remote names.

func (*Git) Reset

func (g *Git) Reset(mode, commit string) *command.Model

Reset the current branch head to commit and possibly updates the index. The mode must be one of the following: --soft, --mixed, --hard, --merge, --keep.

func (*Git) RevList

func (g *Git) RevList(commit string, opts ...string) *command.Model

RevList lists commit objects in reverse chronological order.

func (*Git) RevParse

func (g *Git) RevParse(arg string) *command.Model

RevParse picks out and massage parameters.

func (*Git) SparseCheckoutInit

func (g *Git) SparseCheckoutInit(cone bool) *command.Model

SparseCheckoutInit initializes the sparse-checkout config file.

func (*Git) SparseCheckoutSet

func (g *Git) SparseCheckoutSet(opts ...string) *command.Model

SparseCheckoutSet writes the provided patterns to the sparse-checkout config file.

func (*Git) Status

func (g *Git) Status(opts ...string) *command.Model

Status shows the working tree status.

func (*Git) SubmoduleForeach

func (g *Git) SubmoduleForeach(command *command.Model) *command.Model

SubmoduleForeach evaluates an arbitrary git command in each checked out submodule.

func (*Git) SubmoduleUpdate

func (g *Git) SubmoduleUpdate(opts ...string) *command.Model

SubmoduleUpdate updates the registered submodules.

func (*Git) UpdateRef added in v1.0.13

func (g *Git) UpdateRef(opts ...string) *command.Model

UpdateRef updates the object name stored in a ref safely. With -d flag, it deletes the named <ref>.

Jump to

Keyboard shortcuts

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