{"modulePath":"github.com/gogs/git-module","version":"v1.8.10","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git\n\n## Constants\n\n```go\nconst (\n\tRefsHeads = \"refs/heads/\"\n\tRefsTags  = \"refs/tags/\"\n)\n```\n\n```go\nconst DefaultHooksDir = \"hooks\"\n```\nDefaultHooksDir is the default directory for Git hooks.\n\n```go\nconst DefaultTimeout = time.Minute\n```\nDefaultTimeout is the default timeout duration for all commands.\n\n```go\nconst EmptyID = \"0000000000000000000000000000000000000000\"\n```\nEmptyID is an ID with empty SHA-1 hash.\n\n```go\nconst LogFormatHashOnly = `format:%H`\n```\n\n## Variables\n\n```go\nvar (\n\tErrParentNotExist       = errors.New(\"parent does not exist\")\n\tErrSubmoduleNotExist    = errors.New(\"submodule does not exist\")\n\tErrRevisionNotExist     = errors.New(\"revision does not exist\")\n\tErrRemoteNotExist       = errors.New(\"remote does not exist\")\n\tErrURLNotExist          = errors.New(\"URL does not exist\")\n\tErrExecTimeout          = errors.New(\"execution was timed out\")\n\tErrNoMergeBase          = errors.New(\"no merge based was found\")\n\tErrNotBlob              = errors.New(\"the entry is not a blob\")\n\tErrNotDeleteNonPushURLs = errors.New(\"will not delete all non-push URLs\")\n)\n```\n\n```go\nvar (\n\t// ServerSideHooks contains a list of Git hooks that are supported on the server\n\t// side.\n\tServerSideHooks = []HookName{HookPreReceive, HookUpdate, HookPostReceive}\n\t// ServerSideHookSamples contains samples of Git hooks that are supported on the\n\t// server side.\n\tServerSideHookSamples = map[HookName]string{\n\t\tHookPreReceive: `#!/bin/sh\n#\n# An example hook script to make use of push options.\n# The example simply echoes all push options that start with 'echoback='\n# and rejects all pushes when the \"reject\" push option is used.\n#\n# To enable this hook, rename this file to \"pre-receive\".\n\nif test -n \"$GIT_PUSH_OPTION_COUNT\"\nthen\n\ti=0\n\twhile test \"$i\" -lt \"$GIT_PUSH_OPTION_COUNT\"\n\tdo\n\t\teval \"value=\\$GIT_PUSH_OPTION_$i\"\n\t\tcase \"$value\" in\n\t\techoback=*)\n\t\t\techo \"echo from the pre-receive-hook: ${value#*=}\" \u003e\u00262\n\t\t\t;;\n\t\treject)\n\t\t\texit 1\n\t\tesac\n\t\ti=$((i + 1))\n\tdone\nfi\n`,\n\t\tHookUpdate: `#!/bin/sh\n#\n# An example hook script to block unannotated tags from entering.\n# Called by \"git receive-pack\" with arguments: refname sha1-old sha1-new\n#\n# To enable this hook, rename this file to \"update\".\n#\n# Config\n# ------\n# hooks.allowunannotated\n#   This boolean sets whether unannotated tags will be allowed into the\n#   repository.  By default they won't be.\n# hooks.allowdeletetag\n#   This boolean sets whether deleting tags will be allowed in the\n#   repository.  By default they won't be.\n# hooks.allowmodifytag\n#   This boolean sets whether a tag may be modified after creation. By default\n#   it won't be.\n# hooks.allowdeletebranch\n#   This boolean sets whether deleting branches will be allowed in the\n#   repository.  By default they won't be.\n# hooks.denycreatebranch\n#   This boolean sets whether remotely creating branches will be denied\n#   in the repository.  By default this is allowed.\n#\n\n# --- Command line\nrefname=\"$1\"\noldrev=\"$2\"\nnewrev=\"$3\"\n\n# --- Safety check\nif [ -z \"$GIT_DIR\" ]; then\n\techo \"Don't run this script from the command line.\" \u003e\u00262\n\techo \" (if you want, you could supply GIT_DIR then run\" \u003e\u00262\n\techo \"  $0 \u003cref\u003e \u003coldrev\u003e \u003cnewrev\u003e)\" \u003e\u00262\n\texit 1\nfi\n\nif [ -z \"$refname\" -o -z \"$oldrev\" -o -z \"$newrev\" ]; then\n\techo \"usage: $0 \u003cref\u003e \u003coldrev\u003e \u003cnewrev\u003e\" \u003e\u00262\n\texit 1\nfi\n\n# --- Config\nallowunannotated=$(git config --bool hooks.allowunannotated)\nallowdeletebranch=$(git config --bool hooks.allowdeletebranch)\ndenycreatebranch=$(git config --bool hooks.denycreatebranch)\nallowdeletetag=$(git config --bool hooks.allowdeletetag)\nallowmodifytag=$(git config --bool hooks.allowmodifytag)\n\n# check for no description\nprojectdesc=$(sed -e '1q' \"$GIT_DIR/description\")\ncase \"$projectdesc\" in\n\"Unnamed repository\"* | \"\")\n\techo \"*** Project description file hasn't been set\" \u003e\u00262\n\texit 1\n\t;;\nesac\n\n# --- Check types\n# if $newrev is 0000...0000, it's a commit to delete a ref.\nzero=\"0000000000000000000000000000000000000000\"\nif [ \"$newrev\" = \"$zero\" ]; then\n\tnewrev_type=delete\nelse\n\tnewrev_type=$(git cat-file -t $newrev)\nfi\n\ncase \"$refname\",\"$newrev_type\" in\n\trefs/tags/*,commit)\n\t\t# un-annotated tag\n\t\tshort_refname=${refname##refs/tags/}\n\t\tif [ \"$allowunannotated\" != \"true\" ]; then\n\t\t\techo \"*** The un-annotated tag, $short_refname, is not allowed in this repository\" \u003e\u00262\n\t\t\techo \"*** Use 'git tag [ -a | -s ]' for tags you want to propagate.\" \u003e\u00262\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,delete)\n\t\t# delete tag\n\t\tif [ \"$allowdeletetag\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tag is not allowed in this repository\" \u003e\u00262\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/tags/*,tag)\n\t\t# annotated tag\n\t\tif [ \"$allowmodifytag\" != \"true\" ] \u0026\u0026 git rev-parse $refname \u003e /dev/null 2\u003e\u00261\n\t\tthen\n\t\t\techo \"*** Tag '$refname' already exists.\" \u003e\u00262\n\t\t\techo \"*** Modifying a tag is not allowed in this repository.\" \u003e\u00262\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/heads/*,commit)\n\t\t# branch\n\t\tif [ \"$oldrev\" = \"$zero\" -a \"$denycreatebranch\" = \"true\" ]; then\n\t\t\techo \"*** Creating a branch is not allowed in this repository\" \u003e\u00262\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/heads/*,delete)\n\t\t# delete branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a branch is not allowed in this repository\" \u003e\u00262\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\trefs/remotes/*,commit)\n\t\t# tracking branch\n\t\t;;\n\trefs/remotes/*,delete)\n\t\t# delete tracking branch\n\t\tif [ \"$allowdeletebranch\" != \"true\" ]; then\n\t\t\techo \"*** Deleting a tracking branch is not allowed in this repository\" \u003e\u00262\n\t\t\texit 1\n\t\tfi\n\t\t;;\n\t*)\n\t\t# Anything else (is there anything else?)\n\t\techo \"*** Update hook: unknown type of update to ref $refname of type $newrev_type\" \u003e\u00262\n\t\texit 1\n\t\t;;\nesac\n\n# --- Finished\nexit 0\n`,\n\t\tHookPostReceive: `#!/bin/sh\n#\n# An example hook script for the \"post-receive\" event.\n#\n# The \"post-receive\" script is run after receive-pack has accepted a pack\n# and the repository has been updated.  It is passed arguments in through\n# stdin in the form\n#  \u003coldrev\u003e \u003cnewrev\u003e \u003crefname\u003e\n# For example:\n#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master\n\nwhile read oldrev newrev refname\ndo\n    branch=$(git rev-parse --symbolic --abbrev-ref $refname)\n    if [ \"master\" = \"$branch\" ]; then\n        # Do something\n    fi\ndone`,\n\t}\n)\n```\n\n```go\nvar ErrReferenceNotExist = errors.New(\"reference does not exist\")\n```\n\n## Functions\n\n```go\nfunc Add(repoPath string, opts ...AddOptions) error\n```\nAdd adds local changes to index for the repository in given path.\n\n```go\nfunc ArgsForBinVersion(args []string) ([]string, error)\n```\nArgsForBinVersion returns the Git arguments to run with the Git binary in use. See argsForVersion for how \"--end-of-options\" is handled. Callers that run Git without this package should pass their arguments through it.\n\n```go\nfunc BinVersion() (string, error)\n```\nBinVersion returns current Git binary version that is used by this module.\n\n```go\nfunc Checkout(repoPath, branch string, opts ...CheckoutOptions) error\n```\nCheckout checks out to given branch for the repository in given path.\n\n```go\nfunc Clone(url, dst string, opts ...CloneOptions) error\n```\nClone clones the repository from remote URL to the destination.\n\n```go\nfunc CreateCommit(repoPath string, committer *Signature, message string, opts ...CommitOptions) error\n```\nCreateCommit commits local changes with given author, committer and message for the repository in given path.\n\n```go\nfunc DeleteBranch(repoPath, name string, opts ...DeleteBranchOptions) error\n```\nDeleteBranch deletes the branch from the repository in given path.\n\n```go\nfunc DiffNameOnly(repoPath, base, head string, opts ...DiffNameOnlyOptions) ([]string, error)\n```\nDiffNameOnly returns a list of changed files between base and head revisions of the repository in given path.\n\n```go\nfunc Fsck(repoPath string, opts ...FsckOptions) error\n```\nFsck verifies the connectivity and validity of the objects in the database for the repository in given path.\n\n```go\nfunc HasTag(repoPath, tag string, opts ...ShowRefVerifyOptions) bool\n```\nHasTag returns true if given tag exists in the repository in given path. The tag must be given in short name e.g. \"v1.0.0\".\n\n```go\nfunc Init(path string, opts ...InitOptions) error\n```\nInit initializes a new Git repository.\n\n```go\nfunc IsURLAccessible(timeout time.Duration, url string) bool\n```\nIsURLAccessible returns true if given remote URL is accessible via Git within given timeout.\n\n```go\nfunc MergeBase(repoPath, base, head string, opts ...MergeBaseOptions) (string, error)\n```\nMergeBase returns merge base between base and head revisions of the repository in given path.\n\n```go\nfunc Move(repoPath, src, dst string, opts ...MoveOptions) error\n```\nMove moves a file, a directory, or a symlink file or directory from source to destination for the repository in given path.\n\n```go\nfunc Push(repoPath, remote, branch string, opts ...PushOptions) error\n```\nPush pushes local changes to given remote and branch for the repository in given path.\n\n```go\nfunc ReceivePack(path string, opts ...ReceivePackOptions) ([]byte, error)\n```\nReceivePack receives what is pushed into the repository in given path.\n\n```go\nfunc RefShortName(ref string) string\n```\nRefShortName returns short name of heads or tags. Other references will return original string.\n\n```go\nfunc RemoteAdd(repoPath, name, url string, opts ...RemoteAddOptions) error\n```\nRemoteAdd adds a new remote to the repository in given path.\n\n```go\nfunc RemoteGetURL(repoPath, name string, opts ...RemoteGetURLOptions) ([]string, error)\n```\nRemoteGetURL retrieves URL(s) of a remote of the repository in given path.\n\n```go\nfunc RemoteRemove(repoPath, name string, opts ...RemoteRemoveOptions) error\n```\nRemoteRemove removes a remote from the repository in given path.\n\n```go\nfunc RemoteSetURL(repoPath, name, newurl string, opts ...RemoteSetURLOptions) error\n```\nRemoteSetURL sets first URL of the remote with given name of the repository in given path.\n\n```go\nfunc RemoteSetURLAdd(repoPath, name, newurl string, opts ...RemoteSetURLAddOptions) error\n```\nRemoteSetURLAdd appends an URL to the remote with given name of the repository in given path. Use RemoteSetURL to overwrite the URL(s) instead.\n\n```go\nfunc RemoteSetURLDelete(repoPath, name, regex string, opts ...RemoteSetURLDeleteOptions) error\n```\nRemoteSetURLDelete deletes the remote with given name of the repository in given path.\n\n```go\nfunc Remotes(repoPath string, opts ...RemotesOptions) ([]string, error)\n```\nRemotes lists remotes of the repository in given path.\n\n```go\nfunc RepoAdd(repoPath string, opts ...AddOptions) error\n```\nDeprecated: Use Add instead.\n\n```go\nfunc RepoAddRemote(repoPath, name, url string, opts ...RemoteAddOptions) error\n```\nDeprecated: Use RemoteAdd instead.\n\n```go\nfunc RepoCheckout(repoPath, branch string, opts ...CheckoutOptions) error\n```\nDeprecated: Use Checkout instead.\n\n```go\nfunc RepoCommit(repoPath string, committer *Signature, message string, opts ...CommitOptions) error\n```\nDeprecated: Use CreateCommit instead.\n\n```go\nfunc RepoDeleteBranch(repoPath, name string, opts ...DeleteBranchOptions) error\n```\nDeprecated: Use DeleteBranch instead.\n\n```go\nfunc RepoDiffNameOnly(repoPath, base, head string, opts ...DiffNameOnlyOptions) ([]string, error)\n```\nDeprecated: Use DiffNameOnly instead.\n\n```go\nfunc RepoFsck(repoPath string, opts ...FsckOptions) error\n```\nDeprecated: Use Fsck instead.\n\n```go\nfunc RepoHasBranch(repoPath, branch string, opts ...ShowRefVerifyOptions) bool\n```\nRepoHasBranch returns true if given branch exists in the repository in given path. The branch must be given in short name e.g. \"master\".\n\n```go\nfunc RepoHasReference(repoPath, ref string, opts ...ShowRefVerifyOptions) bool\n```\nRepoHasReference returns true if given reference exists in the repository in given path. The reference must be given in full refspec, e.g. \"refs/heads/master\".\n\n```go\nfunc RepoHasTag(repoPath, tag string, opts ...ShowRefVerifyOptions) bool\n```\nDeprecated: Use HasTag instead.\n\n```go\nfunc RepoMergeBase(repoPath, base, head string, opts ...MergeBaseOptions) (string, error)\n```\nDeprecated: Use MergeBase instead.\n\n```go\nfunc RepoMove(repoPath, src, dst string, opts ...MoveOptions) error\n```\nDeprecated: Use Move instead.\n\n```go\nfunc RepoPush(repoPath, remote, branch string, opts ...PushOptions) error\n```\nDeprecated: Use Push instead.\n\n```go\nfunc RepoRemoveRemote(repoPath, name string, opts ...RemoteRemoveOptions) error\n```\nDeprecated: Use RemoteRemove instead.\n\n```go\nfunc RepoReset(repoPath, rev string, opts ...ResetOptions) error\n```\nDeprecated: Use Reset instead.\n\n```go\nfunc RepoShowRefVerify(repoPath, ref string, opts ...ShowRefVerifyOptions) (string, error)\n```\nDeprecated: Use ShowRefVerify instead.\n\n```go\nfunc RepoTags(repoPath string, opts ...TagsOptions) ([]string, error)\n```\nRepoTags returns a list of tags of the repository in given path.\n\n```go\nfunc Reset(repoPath, rev string, opts ...ResetOptions) error\n```\nReset resets working tree to given revision for the repository in given path.\n\n```go\nfunc SetOutput(output io.Writer)\n```\nSetOutput sets the output writer for logs.\n\n```go\nfunc SetPrefix(prefix string)\n```\nSetPrefix sets the prefix to be prepended to each log entry.\n\n```go\nfunc ShowRefVerify(repoPath, ref string, opts ...ShowRefVerifyOptions) (string, error)\n```\nShowRefVerify returns the commit ID of given reference if it exists in the repository in given path.\n\n```go\nfunc StreamParseDiff(r io.Reader, done chan\u003c- SteamParseDiffResult, maxFiles, maxFileLines, maxLineChars int)\n```\nStreamParseDiff parses the diff read from the given io.Reader. It does parse-on-read to minimize the time spent on huge diffs. It accepts a channel to notify and send error (if any) to the caller when the process is done. Therefore, this method should be called in a goroutine asynchronously.\n\n```go\nfunc SymbolicRef(repoPath string, opts ...SymbolicRefOptions) (string, error)\n```\nSymbolicRef returns the reference name (e.g. \"refs/heads/master\") pointed by the symbolic ref in the repository in given path. It returns an empty string and nil error when doing set operation.\n\n```go\nfunc UnescapeChars(in []byte) []byte\n```\nUnescapeChars reverses escaped characters in quoted output from Git.\n\n```go\nfunc UpdateServerInfo(path string, opts ...UpdateServerInfoOptions) error\n```\nUpdateServerInfo updates the auxiliary info file on the server side for the repository in given path.\n\n```go\nfunc UploadPack(path string, opts ...UploadPackOptions) ([]byte, error)\n```\nUploadPack sends the packfile to the client for the repository in given path.\n\n## Types\n\n```go\ntype AddOptions struct {\n\t// Indicates whether to add all changes to index.\n\tAll bool\n\t// The specific pathspecs to be added to index.\n\tPathspecs []string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nAddOptions contains optional arguments for adding local changes.\n\nDocs: [https://git-scm.com/docs/git-add](https://git-scm.com/docs/git-add)\n\n```go\ntype AddRemoteOptions = RemoteAddOptions\n```\nDeprecated: Use RemoteAddOptions instead.\n\n```go\ntype ArchiveFormat string\n```\nArchiveFormat is the format of an archive.\n\n```go\nconst (\n\tArchiveZip   ArchiveFormat = \"zip\"\n\tArchiveTarGz ArchiveFormat = \"tar.gz\"\n)\n```\nA list of formats can be created by Git for an archive.\n\n```go\ntype Blame struct {\n\t// contains filtered or unexported fields\n}\n```\nBlame contains information of a Git file blame.\n\n```go\nfunc (b *Blame) Line(i int) *Commit\n```\nLine returns the commit by given line number (1-based). It returns nil when no such line.\n\n```go\ntype BlameOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nBlameOptions contains optional arguments for blaming a file. Docs: [https://git-scm.com/docs/git-blame](https://git-scm.com/docs/git-blame)\n\n```go\ntype Blob struct {\n\t*TreeEntry\n}\n```\nBlob is a blob object.\n\n```go\nfunc (b *Blob) Bytes() ([]byte, error)\n```\nBytes reads and returns the content of the blob all at once in bytes. This can be very slow and memory consuming for huge content.\n\n```go\nfunc (b *Blob) Pipeline(stdout, stderr io.Writer) error\n```\nPipeline reads the content of the blob and pipes stdout and stderr to supplied io.Writer.\n\n```go\ntype CatFileBlobOptions struct {\n\t// The timeout duration before giving up for each shell command execution.\n\t// The default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCatFileBlobOptions contains optional arguments for verifying the objects.\n\nDocs: [https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt](https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt)\n\n```go\ntype CatFileCommitOptions struct {\n\t// The timeout duration before giving up for each shell command execution.\n\t// The default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCatFileCommitOptions contains optional arguments for verifying the objects.\n\nDocs: [https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt-lttypegt](https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt-lttypegt)\n\n```go\ntype CatFileTypeOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCatFileTypeOptions contains optional arguments for showing the object type.\n\nDocs: [https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt--t](https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt--t)\n\n```go\ntype CheckoutOptions struct {\n\t// The base branch if checks out to a new branch.\n\tBaseBranch string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCheckoutOptions contains optional arguments for checking out to a branch.\n\nDocs: [https://git-scm.com/docs/git-checkout](https://git-scm.com/docs/git-checkout)\n\n```go\ntype CloneOptions struct {\n\t// Indicates whether the repository should be cloned as a mirror.\n\tMirror bool\n\t// Indicates whether the repository should be cloned in bare format.\n\tBare bool\n\t// Indicates whether to suppress the log output.\n\tQuiet bool\n\t// The branch to checkout for the working tree when Bare=false.\n\tBranch string\n\t// The number of revisions to clone.\n\tDepth uint64\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCloneOptions contains optional arguments for cloning a repository.\n\nDocs: [https://git-scm.com/docs/git-clone](https://git-scm.com/docs/git-clone)\n\n```go\ntype Command struct {\n\t// contains filtered or unexported fields\n}\n```\nCommand contains the name, arguments and environment variables of a command.\n\n```go\nfunc NewCommand(args ...string) *Command\n```\nNewCommand creates and returns a new Command with given arguments for \"git\".\n\n```go\nfunc NewCommandWithContext(ctx context.Context, args ...string) *Command\n```\nNewCommandWithContext creates and returns a new Command with given arguments and context for \"git\".\n\n```go\nfunc (c *Command) AddArgs(args ...string) *Command\n```\nAddArgs appends given arguments to the command.\n\n```go\nfunc (c *Command) AddCommitter(committer *Signature) *Command\n```\nAddCommitter appends given committer to the command.\n\n```go\nfunc (c *Command) AddEnvs(envs ...string) *Command\n```\nAddEnvs appends given environment variables to the command.\n\n```go\nfunc (c *Command) AddOptions(opts ...CommandOptions) *Command\n```\nAddOptions adds options to the command. Note: only the last option will take effect if there are duplicated options.\n\n```go\nfunc (c *Command) Run() ([]byte, error)\n```\nRun executes the command in working directory and default timeout duration. It returns stdout in string and error (combined with stderr).\n\n```go\nfunc (c *Command) RunInDir(dir string) ([]byte, error)\n```\nRunInDir executes the command in given directory and default timeout duration. It returns stdout and error (combined with stderr).\n\n```go\nfunc (c *Command) RunInDirPipeline(stdout, stderr io.Writer, dir string) error\n```\nRunInDirPipeline executes the command in given directory and default timeout duration. It pipes stdout and stderr to supplied io.Writer.\n\n```go\nfunc (c *Command) RunInDirPipelineWithTimeout(timeout time.Duration, stdout, stderr io.Writer, dir string) (err error)\n```\nRunInDirPipelineWithTimeout executes the command in given directory and timeout duration. It pipes stdout and stderr to supplied io.Writer. DefaultTimeout will be used if the timeout duration is less than time.Nanosecond (i.e. less than or equal to 0). It returns an ErrExecTimeout if the execution was timed out.\n\nDeprecated: Use RunInDirPipeline and CommandOptions instead. TODO: remove this in the next major version\n\n```go\nfunc (c *Command) RunInDirWithOptions(dir string, opts ...RunInDirOptions) (err error)\n```\nRunInDirWithOptions executes the command in given directory and options. It pipes stdin from supplied io.Reader, and pipes stdout and stderr to supplied io.Writer. DefaultTimeout will be used if the timeout duration is less than time.Nanosecond (i.e. less than or equal to 0). It returns an ErrExecTimeout if the execution was timed out.\n\n```go\nfunc (c *Command) RunInDirWithTimeout(timeout time.Duration, dir string) ([]byte, error)\n```\nRunInDirWithTimeout executes the command in given directory and timeout duration. It returns stdout in \\[]byte and error (combined with stderr).\n\nDeprecated: Use RunInDir and CommandOptions instead. TODO: remove this in the next major version\n\n```go\nfunc (c *Command) RunWithTimeout(timeout time.Duration) ([]byte, error)\n```\nRunWithTimeout executes the command in working directory and given timeout duration. It returns stdout in string and error (combined with stderr).\n\nDeprecated: Use RunInDir and CommandOptions instead. TODO: remove this in the next major version\n\n```go\nfunc (c *Command) SetTimeout(timeout time.Duration)\n```\nSetTimeout sets the timeout for the command.\n\n```go\nfunc (c *Command) String() string\n```\nString returns the string representation of the command.\n\n```go\nfunc (c Command) WithContext(ctx context.Context) *Command\n```\nWithContext returns a new Command with the given context.\n\n```go\nfunc (c Command) WithTimeout(timeout time.Duration) *Command\n```\nWithTimeout returns a new Command with given timeout.\n\n```go\ntype CommandOptions struct {\n\tArgs    []string\n\tEnvs    []string\n\tTimeout time.Duration\n\tContext context.Context\n}\n```\nCommandOptions contains options for running a command. If timeout is zero, DefaultTimeout will be used. If timeout is less than zero, no timeout will be set. If context is nil, context.Background() will be used.\n\n```go\ntype Commit struct {\n\t// The SHA-1 hash of the commit.\n\tID *SHA1\n\t//  The author of the commit.\n\tAuthor *Signature\n\t// The committer of the commit.\n\tCommitter *Signature\n\t// The full commit message.\n\tMessage string\n\n\t*Tree\n\t// contains filtered or unexported fields\n}\n```\nCommit contains information of a Git commit.\n\n```go\nfunc Log(repoPath, rev string, opts ...LogOptions) ([]*Commit, error)\n```\nLog returns a list of commits in the state of given revision of the repository in given path. The returned list is in reverse chronological order.\n\n```go\nfunc RepoLog(repoPath, rev string, opts ...LogOptions) ([]*Commit, error)\n```\nDeprecated: Use Log instead.\n\n```go\nfunc (c *Commit) Ancestors(opts ...LogOptions) ([]*Commit, error)\n```\nAncestors returns a list of ancestors of this commit in reverse chronological order.\n\n```go\nfunc (c *Commit) CommitByPath(opts ...CommitByRevisionOptions) (*Commit, error)\n```\nCommitByPath returns the commit of the path in the state of this commit.\n\n```go\nfunc (c *Commit) CommitsAfter(after string, opts ...RevListOptions) ([]*Commit, error)\n```\nCommitsAfter returns a list of commits after given commit ID up to this commit. The returned list is in reverse chronological order.\n\n```go\nfunc (c *Commit) CommitsByPage(page, size int, opts ...CommitsByPageOptions) ([]*Commit, error)\n```\nCommitsByPage returns a paginated list of commits in the state of this commit. The returned list is in reverse chronological order.\n\n```go\nfunc (c *Commit) CommitsCount(opts ...RevListCountOptions) (int64, error)\n```\nCommitsCount returns number of total commits up to this commit.\n\n```go\nfunc (c *Commit) CreateArchive(format ArchiveFormat, dst string) error\n```\nCreateArchive creates given format of archive to the destination.\n\n```go\nfunc (c *Commit) FilesChangedAfter(after string, opts ...DiffNameOnlyOptions) ([]string, error)\n```\nFilesChangedAfter returns a list of files changed after given commit ID.\n\n```go\nfunc (c *Commit) IsImageFile(subpath string) (bool, error)\n```\nIsImageFile returns true if the blob of the commit is an image by subpath.\n\n```go\nfunc (c *Commit) IsImageFileByIndex(index string) (bool, error)\n```\nIsImageFileByIndex returns true if the blob of the commit is an image by index.\n\n```go\nfunc (c *Commit) Parent(n int, opts ...CatFileCommitOptions) (*Commit, error)\n```\nParent returns the n-th parent commit (0-based) of this commit. It returns ErrRevisionNotExist if no such parent exists.\n\n```go\nfunc (c *Commit) ParentID(n int) (*SHA1, error)\n```\nParentID returns the SHA-1 hash of the n-th parent (0-based) of this commit. It returns an ErrParentNotExist if no such parent exists.\n\n```go\nfunc (c *Commit) ParentsCount() int\n```\nParentsCount returns number of parents of the commit. It returns 0 if this is the root commit, otherwise returns 1, 2, etc.\n\n```go\nfunc (c *Commit) SearchCommits(pattern string, opts ...SearchCommitsOptions) ([]*Commit, error)\n```\nSearchCommits searches commit message with given pattern. The returned list is in reverse chronological order.\n\n```go\nfunc (c *Commit) ShowNameStatus(opts ...ShowNameStatusOptions) (*NameStatus, error)\n```\nShowNameStatus returns name status of the commit.\n\n```go\nfunc (c *Commit) Submodule(path string) (*Submodule, error)\n```\nSubmodule returns submodule by given name. It returns an ErrSubmoduleNotExist if the path does not exist as a submodule.\n\n```go\nfunc (c *Commit) Submodules() (Submodules, error)\n```\nSubmodules returns submodules found in this commit.\n\n```go\nfunc (c *Commit) Summary() string\n```\nSummary returns first line of commit message.\n\n```go\ntype CommitByRevisionOptions struct {\n\t// The relative path of the repository.\n\tPath string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCommitByRevisionOptions contains optional arguments for getting a commit.\n\nDocs: [https://git-scm.com/docs/git-log](https://git-scm.com/docs/git-log)\n\n```go\ntype CommitOptions struct {\n\t// Author is the author of the changes if that's not the same as committer.\n\tAuthor *Signature\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCommitOptions contains optional arguments to commit changes.\n\nDocs: [https://git-scm.com/docs/git-commit](https://git-scm.com/docs/git-commit)\n\n```go\ntype CommitsByPageOptions struct {\n\t// The relative path of the repository.\n\tPath string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCommitsByPageOptions contains optional arguments for getting paginated commits.\n\nDocs: [https://git-scm.com/docs/git-log](https://git-scm.com/docs/git-log)\n\n```go\ntype CommitsInfoOptions struct {\n\t// The relative path of the repository.\n\tPath string\n\t// The maximum number of goroutines to be used for getting commits information.\n\t// When not set (i.e. \u003c=0), runtime.GOMAXPROCS is used to determine the value.\n\tMaxConcurrency int\n\t// The timeout duration before giving up for each shell command execution.\n\t// The default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n}\n```\nCommitsInfoOptions contains optional arguments for getting commits information.\n\n```go\ntype CommitsSinceOptions struct {\n\t// The relative path of the repository.\n\tPath string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCommitsSinceOptions contains optional arguments for listing commits since a time.\n\nDocs: [https://git-scm.com/docs/git-log](https://git-scm.com/docs/git-log)\n\n```go\ntype CountObject struct {\n\tCount         int64\n\tSize          int64\n\tInPack        int64\n\tPacks         int64\n\tSizePack      int64\n\tPrunePackable int64\n\tGarbage       int64\n\tSizeGarbage   int64\n}\n```\nCountObject contains disk usage report of a repository.\n\n```go\nfunc CountObjects(repoPath string, opts ...CountObjectsOptions) (*CountObject, error)\n```\nCountObjects returns disk usage report of the repository in given path.\n\n```go\nfunc RepoCountObjects(repoPath string, opts ...CountObjectsOptions) (*CountObject, error)\n```\nDeprecated: Use CountObjects instead.\n\n```go\ntype CountObjectsOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCountObjectsOptions contains optional arguments for counting objects.\n\nDocs: [https://git-scm.com/docs/git-count-objects](https://git-scm.com/docs/git-count-objects)\n\n```go\ntype CreateTagOptions struct {\n\t// Annotated marks a tag as annotated rather than lightweight.\n\tAnnotated bool\n\t// Message specifies a tagging message for the annotated tag. It is ignored when tag is not annotated.\n\tMessage string\n\t// Author is the author of the tag. It is ignored when tag is not annotated.\n\tAuthor *Signature\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nCreateTagOptions contains optional arguments for creating a tag.\n\nDocs: [https://git-scm.com/docs/git-tag](https://git-scm.com/docs/git-tag)\n\n```go\ntype DeleteBranchOptions struct {\n\t// Indicates whether to force delete the branch.\n\tForce bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nDeleteBranchOptions contains optional arguments for deleting a branch.\n\nDocs: [https://git-scm.com/docs/git-branch](https://git-scm.com/docs/git-branch)\n\n```go\ntype DeleteTagOptions struct {\n\t// The timeout duration before giving up for each shell command execution.\n\t// The default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nDeleteTagOptions contains optional arguments for deleting a tag.\n\nDocs: [https://git-scm.com/docs/git-tag#Documentation/git-tag.txt---delete](https://git-scm.com/docs/git-tag#Documentation/git-tag.txt---delete)\n\n```go\ntype Diff struct {\n\tFiles []*DiffFile // The files in the diff\n\t// contains filtered or unexported fields\n}\n```\nDiff represents a Git diff.\n\n```go\nfunc (d *Diff) IsIncomplete() bool\n```\nIsIncomplete returns true if the file is incomplete to the entire diff.\n\n```go\nfunc (d *Diff) NumFiles() int\n```\nNumFiles returns the number of files in the diff.\n\n```go\nfunc (d *Diff) TotalAdditions() int\n```\nTotalAdditions returns the total additions in the diff.\n\n```go\nfunc (d *Diff) TotalDeletions() int\n```\nTotalDeletions returns the total deletions in the diff.\n\n```go\ntype DiffBinaryOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nDiffBinaryOptions contains optional arguments for producing binary patch.\n\n```go\ntype DiffFile struct {\n\t// The name of the file.\n\tName string\n\t// The type of the file.\n\tType DiffFileType\n\t// The index (SHA1 hash) of the file. For a changed/new file, it is the new SHA,\n\t// and for a deleted file it becomes \"000000\".\n\tIndex string\n\t// OldIndex is the old index (SHA1 hash) of the file.\n\tOldIndex string\n\t// The sections in the file.\n\tSections []*DiffSection\n\t// contains filtered or unexported fields\n}\n```\nDiffFile represents a file in diff.\n\n```go\nfunc (f *DiffFile) IsBinary() bool\n```\nIsBinary returns true if the file is in binary format.\n\n```go\nfunc (f *DiffFile) IsCreated() bool\n```\nIsCreated returns true if the file is newly created.\n\n```go\nfunc (f *DiffFile) IsDeleted() bool\n```\nIsDeleted returns true if the file has been deleted.\n\n```go\nfunc (f *DiffFile) IsIncomplete() bool\n```\nIsIncomplete returns true if the file is incomplete to the file diff.\n\n```go\nfunc (f *DiffFile) IsRenamed() bool\n```\nIsRenamed returns true if the file has been renamed.\n\n```go\nfunc (f *DiffFile) IsSubmodule() bool\n```\nIsSubmodule returns true if the file contains information of a submodule.\n\n```go\nfunc (f *DiffFile) Mode() EntryMode\n```\nMode returns the mode of the file.\n\n```go\nfunc (f *DiffFile) NumAdditions() int\n```\nNumAdditions returns the number of additions in the file.\n\n```go\nfunc (f *DiffFile) NumDeletions() int\n```\nNumDeletions returns the number of deletions in the file.\n\n```go\nfunc (f *DiffFile) NumSections() int\n```\nNumSections returns the number of sections in the file.\n\n```go\nfunc (f *DiffFile) OldMode() EntryMode\n```\nOldMode returns the old mode of the file if it's changed.\n\n```go\nfunc (f *DiffFile) OldName() string\n```\nOldName returns previous name before renaming.\n\n```go\ntype DiffFileType uint8\n```\nDiffFileType is the file status in diff.\n\n```go\nconst (\n\tDiffFileAdd DiffFileType = iota + 1\n\tDiffFileChange\n\tDiffFileDelete\n\tDiffFileRename\n)\n```\nA list of different file statuses.\n\n```go\ntype DiffLine struct {\n\tType      DiffLineType // The type of the line\n\tContent   string       // The content of the line\n\tLeftLine  int          // The left line number\n\tRightLine int          // The right line number\n}\n```\nDiffLine represents a line in diff.\n\n```go\ntype DiffLineType uint8\n```\nDiffLineType is the line type in diff.\n\n```go\nconst (\n\tDiffLinePlain DiffLineType = iota + 1\n\tDiffLineAdd\n\tDiffLineDelete\n\tDiffLineSection\n)\n```\nA list of different line types.\n\n```go\ntype DiffNameOnlyOptions struct {\n\t// Indicates whether two commits should have a merge base.\n\tNeedsMergeBase bool\n\t// The relative path of the repository.\n\tPath string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nDiffNameOnlyOptions contains optional arguments for listing changed files.\n\nDocs: [https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---name-only](https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---name-only)\n\n```go\ntype DiffOptions struct {\n\t// The commit ID to used for computing diff between a range of commits (base,\n\t// revision]. When not set, only computes diff for a single commit at revision.\n\tBase string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nDiffOptions contains optional arguments for parsing diff.\n\nDocs: [https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---full-index](https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---full-index)\n\n```go\ntype DiffSection struct {\n\tLines []*DiffLine // lines in the section\n\t// contains filtered or unexported fields\n}\n```\nDiffSection represents a section in diff.\n\n```go\nfunc (s *DiffSection) Line(typ DiffLineType, line int) *DiffLine\n```\nLine returns a specific line by given type and line number in a section.\n\n```go\nfunc (s *DiffSection) NumLines() int\n```\nNumLines returns the number of lines in the section.\n\n```go\ntype Entries []*TreeEntry\n```\nEntries is a sortable list of tree entries.\n\n```go\nfunc (es Entries) CommitsInfo(commit *Commit, opts ...CommitsInfoOptions) ([]*EntryCommitInfo, error)\n```\nCommitsInfo returns a list of commit information for these tree entries in the state of given commit and subpath. It takes advantages of concurrency to speed up the process. The returned list has the same number of items as tree entries, so the caller can access them via slice indices.\n\n```go\nfunc (es Entries) Len() int\n```\n\n```go\nfunc (es Entries) Less(i, j int) bool\n```\n\n```go\nfunc (es Entries) Sort()\n```\n\n```go\nfunc (es Entries) Swap(i, j int)\n```\n\n```go\ntype EntryCommitInfo struct {\n\tEntry     *TreeEntry\n\tIndex     int\n\tCommit    *Commit\n\tSubmodule *Submodule\n}\n```\nEntryCommitInfo contains a tree entry with its commit information.\n\n```go\ntype EntryMode int\n```\nEntryMode is the unix file mode of a tree entry.\n\n```go\nconst (\n\tEntryTree    EntryMode = 0040000\n\tEntryBlob    EntryMode = 0100644\n\tEntryExec    EntryMode = 0100755\n\tEntrySymlink EntryMode = 0120000\n\tEntryCommit  EntryMode = 0160000\n)\n```\nThere are only a few file modes in Git. They look like unix file modes, but they can only be one of these.\n\n```go\ntype FetchOptions struct {\n\t// Indicates whether to prune during fetching.\n\tPrune bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nFetchOptions contains optional arguments for fetching repository updates.\n\nDocs: [https://git-scm.com/docs/git-fetch](https://git-scm.com/docs/git-fetch)\n\n```go\ntype FsckOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nFsckOptions contains optional arguments for verifying the objects.\n\nDocs: [https://git-scm.com/docs/git-fsck](https://git-scm.com/docs/git-fsck)\n\n```go\ntype GrepOptions struct {\n\t// The tree to run the search. Defaults to \"HEAD\".\n\tTree string\n\t// Limits the search to files in the specified pathspec.\n\tPathspec string\n\t// Whether to do case insensitive search.\n\tIgnoreCase bool\n\t// Whether to match the pattern only at word boundaries.\n\tWordRegexp bool\n\t// Whether use extended regular expressions.\n\tExtendedRegexp bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nGrepOptions contains optional arguments for grep search over repository files.\n\nDocs: [https://git-scm.com/docs/git-grep](https://git-scm.com/docs/git-grep)\n\n```go\ntype GrepResult struct {\n\t// The tree of the file that matched, e.g. \"HEAD\".\n\tTree string\n\t// The path of the file that matched.\n\tPath string\n\t// The line number of the match.\n\tLine int\n\t// The 1-indexed column number of the match.\n\tColumn int\n\t// The text of the line that matched.\n\tText string\n}\n```\nGrepResult represents a single result from a grep search.\n\n```go\ntype Hook struct {\n\t// contains filtered or unexported fields\n}\n```\nHook contains information of a Git hook.\n\n```go\nfunc (h *Hook) Content() string\n```\nContent returns the content of the Git hook.\n\n```go\nfunc (h *Hook) IsSample() bool\n```\nIsSample returns true if the content is read from the sample hook.\n\n```go\nfunc (h *Hook) Name() HookName\n```\nName returns the name of the Git hook.\n\n```go\nfunc (h *Hook) Path() string\n```\nPath returns the path of the Git hook.\n\n```go\nfunc (h *Hook) Update(content string) error\n```\nUpdate writes the content of the Git hook on filesystem. It updates the memory copy of the content as well.\n\n```go\ntype HookName string\n```\nHookName is the name of a Git hook.\n\n```go\nconst (\n\tHookPreReceive  HookName = \"pre-receive\"\n\tHookUpdate      HookName = \"update\"\n\tHookPostReceive HookName = \"post-receive\"\n)\n```\nA list of Git server hooks' name that are supported.\n\n```go\ntype InitOptions struct {\n\t// Indicates whether the repository should be initialized in bare format.\n\tBare bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nInitOptions contains optional arguments for initializing a repository.\n\nDocs: [https://git-scm.com/docs/git-init](https://git-scm.com/docs/git-init)\n\n```go\ntype LatestCommitTimeOptions struct {\n\t// To get the latest commit time of the branch. When not set, it checks all branches.\n\tBranch string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nLatestCommitTimeOptions contains optional arguments for getting the latest commit time.\n\n```go\ntype LogOptions struct {\n\t// The maximum number of commits to output.\n\tMaxCount int\n\t// The number commits skipped before starting to show the commit output.\n\tSkip int\n\t// To only show commits since the time.\n\tSince time.Time\n\t// The regular expression to filter commits by their messages.\n\tGrepPattern string\n\t// Indicates whether to ignore letter case when match the regular expression.\n\tRegexpIgnoreCase bool\n\t// The relative path of the repository.\n\tPath string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nLogOptions contains optional arguments for listing commits.\n\nDocs: [https://git-scm.com/docs/git-log](https://git-scm.com/docs/git-log)\n\n```go\ntype LsRemoteOptions struct {\n\t// Indicates whether include heads.\n\tHeads bool\n\t// Indicates whether include tags.\n\tTags bool\n\t// Indicates whether to not show peeled tags or pseudo refs.\n\tRefs bool\n\t// The list of patterns to filter results.\n\tPatterns []string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nLsRemoteOptions contains arguments for listing references in a remote repository.\n\nDocs: [https://git-scm.com/docs/git-ls-remote](https://git-scm.com/docs/git-ls-remote)\n\n```go\ntype LsTreeOptions struct {\n\t// Verbatim outputs filenames unquoted using the -z flag. This avoids issues\n\t// with special characters in filenames that would otherwise be quoted by Git.\n\tVerbatim bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying Git.\n\tCommandOptions\n}\n```\nLsTreeOptions contains optional arguments for listing trees.\n\nDocs: [https://git-scm.com/docs/git-ls-tree](https://git-scm.com/docs/git-ls-tree)\n\n```go\ntype MergeBaseOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nMergeBaseOptions contains optional arguments for getting merge base.\n\nDocs: [https://git-scm.com/docs/git-merge-base](https://git-scm.com/docs/git-merge-base)\n\n```go\ntype MoveOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nMoveOptions contains optional arguments for moving a file, a directory, or a symlink.\n\nDocs: [https://git-scm.com/docs/git-mv](https://git-scm.com/docs/git-mv)\n\n```go\ntype NameStatus struct {\n\tAdded    []string\n\tRemoved  []string\n\tModified []string\n}\n```\nNameStatus contains name status of a commit.\n\n```go\nfunc RepoShowNameStatus(repoPath, rev string, opts ...ShowNameStatusOptions) (*NameStatus, error)\n```\nDeprecated: Use ShowNameStatus instead.\n\n```go\nfunc ShowNameStatus(repoPath, rev string, opts ...ShowNameStatusOptions) (*NameStatus, error)\n```\nShowNameStatus returns name status of given revision of the repository in given path.\n\n```go\ntype ObjectType string\n```\nObjectType is the type of a Git objet.\n\n```go\nconst (\n\tObjectCommit ObjectType = \"commit\"\n\tObjectTree   ObjectType = \"tree\"\n\tObjectBlob   ObjectType = \"blob\"\n\tObjectTag    ObjectType = \"tag\"\n)\n```\nA list of object types.\n\n```go\ntype PullOptions struct {\n\t// Indicates whether to rebased during pulling.\n\tRebase bool\n\t// Indicates whether to pull from all remotes.\n\tAll bool\n\t// The remote to pull updates from when All=false.\n\tRemote string\n\t// The branch to pull updates from when All=false and Remote is supplied.\n\tBranch string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nPullOptions contains optional arguments for pulling repository updates.\n\nDocs: [https://git-scm.com/docs/git-pull](https://git-scm.com/docs/git-pull)\n\n```go\ntype PushOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nPushOptions contains optional arguments for pushing repository changes.\n\nDocs: [https://git-scm.com/docs/git-push](https://git-scm.com/docs/git-push)\n\n```go\ntype RawDiffFormat string\n```\nRawDiffFormat is the format of a raw diff.\n\n```go\nconst (\n\tRawDiffNormal RawDiffFormat = \"diff\"\n\tRawDiffPatch  RawDiffFormat = \"patch\"\n)\n```\n\n```go\ntype RawDiffOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRawDiffOptions contains optional arguments for dumping a raw diff.\n\nDocs: [https://git-scm.com/docs/git-format-patch](https://git-scm.com/docs/git-format-patch)\n\n```go\ntype ReceivePackOptions struct {\n\t// Indicates whether to suppress the log output.\n\tQuiet bool\n\t// Indicates whether to generate the \"info/refs\" used by the \"git http-backend\".\n\tHTTPBackendInfoRefs bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nReceivePackOptions contains optional arguments for receiving the info pushed to the repository.\n\nDocs: [https://git-scm.com/docs/git-receive-pack](https://git-scm.com/docs/git-receive-pack)\n\n```go\ntype Reference struct {\n\tID      string\n\tRefspec string\n}\n```\nReference contains information of a Git reference.\n\n```go\nfunc LsRemote(url string, opts ...LsRemoteOptions) ([]*Reference, error)\n```\nLsRemote returns a list references in the remote repository.\n\n```go\ntype RemoteAddOptions struct {\n\t// Indicates whether to execute git fetch after the remote information is set\n\t// up.\n\tFetch bool\n\t// Indicates whether to add remote as mirror with --mirror=fetch.\n\tMirrorFetch bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRemoteAddOptions contains options to add a remote address.\n\nDocs: [https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emaddem](https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emaddem)\n\n```go\ntype RemoteGetURLOptions struct {\n\t// Indicates whether to get push URLs instead of fetch URLs.\n\tPush bool\n\t// Indicates whether to get all URLs, including lists that are not part of main\n\t// URLs. This option is independent of the Push option.\n\tAll bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRemoteGetURLOptions contains arguments for retrieving URL(s) of a remote of the repository.\n\nDocs: [https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emget-urlem](https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emget-urlem)\n\n```go\ntype RemoteRemoveOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRemoteRemoveOptions contains arguments for removing a remote from the repository.\n\nDocs: [https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emremoveem](https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emremoveem)\n\n```go\ntype RemoteSetURLAddOptions struct {\n\t// Indicates whether to get push URLs instead of fetch URLs.\n\tPush bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRemoteSetURLAddOptions contains arguments for appending an URL to a remote of the repository.\n\nDocs: [https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-urlem](https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-urlem)\n\n```go\ntype RemoteSetURLDeleteOptions struct {\n\t// Indicates whether to get push URLs instead of fetch URLs.\n\tPush bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRemoteSetURLDeleteOptions contains arguments for deleting an URL of a remote of the repository.\n\nDocs: [https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-urlem](https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-urlem)\n\n```go\ntype RemoteSetURLOptions struct {\n\t// Indicates whether to get push URLs instead of fetch URLs.\n\tPush bool\n\t// The regex to match existing URLs to replace (instead of first).\n\tRegex string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRemoteSetURLOptions contains arguments for setting an URL of a remote of the repository.\n\nDocs: [https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-urlem](https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-urlem)\n\n```go\ntype RemotesOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRemotesOptions contains arguments for listing remotes of the repository. / Docs: [https://git-scm.com/docs/git-remote#\\_commands](https://git-scm.com/docs/git-remote#_commands)\n\n```go\ntype RemoveRemoteOptions = RemoteRemoveOptions\n```\nDeprecated: Use RemoteRemoveOptions instead.\n\n```go\ntype Repository struct {\n\t// contains filtered or unexported fields\n}\n```\nRepository contains information of a Git repository.\n\n```go\nfunc Open(repoPath string) (*Repository, error)\n```\nOpen opens the repository at the given path. It returns an os.ErrNotExist if the path does not exist.\n\n```go\nfunc (r *Repository) Add(opts ...AddOptions) error\n```\nAdd adds local changes to index for the repository.\n\n```go\nfunc (r *Repository) AddRemote(name, url string, opts ...RemoteAddOptions) error\n```\nDeprecated: Use RemoteAdd instead.\n\n```go\nfunc (r *Repository) BlameFile(rev, file string, opts ...BlameOptions) (*Blame, error)\n```\nBlameFile returns blame results of the file with the given revision of the repository.\n\n```go\nfunc (r *Repository) BranchCommit(branch string, opts ...CatFileCommitOptions) (*Commit, error)\n```\nBranchCommit returns the latest commit of given branch of the repository. The branch must be given in short name e.g. \"master\".\n\n```go\nfunc (r *Repository) BranchCommitID(branch string, opts ...ShowRefVerifyOptions) (string, error)\n```\nBranchCommitID returns the commit ID of given branch if it exists in the repository. The branch must be given in short name e.g. \"master\".\n\n```go\nfunc (r *Repository) Branches() ([]string, error)\n```\nBranches returns a list of all branches in the repository.\n\n```go\nfunc (r *Repository) CatFileBlob(rev string, opts ...CatFileBlobOptions) (*Blob, error)\n```\nCatFileBlob returns the blob corresponding to the given revision of the repository.\n\n```go\nfunc (r *Repository) CatFileCommit(rev string, opts ...CatFileCommitOptions) (*Commit, error)\n```\nCatFileCommit returns the commit corresponding to the given revision of the repository. The revision could be a commit ID or full refspec (e.g. \"refs/heads/master\").\n\n```go\nfunc (r *Repository) CatFileType(rev string, opts ...CatFileTypeOptions) (ObjectType, error)\n```\nCatFileType returns the object type of given revision of the repository.\n\n```go\nfunc (r *Repository) Checkout(branch string, opts ...CheckoutOptions) error\n```\nCheckout checks out to given branch for the repository.\n\n```go\nfunc (r *Repository) Commit(committer *Signature, message string, opts ...CommitOptions) error\n```\nCommit commits local changes with given author, committer and message for the repository.\n\n```go\nfunc (r *Repository) CommitByRevision(rev string, opts ...CommitByRevisionOptions) (*Commit, error)\n```\nCommitByRevision returns a commit by given revision.\n\n```go\nfunc (r *Repository) CommitsByPage(rev string, page, size int, opts ...CommitsByPageOptions) ([]*Commit, error)\n```\nCommitsByPage returns a paginated list of commits in the state of given revision. The pagination starts from the newest to the oldest commit.\n\n```go\nfunc (r *Repository) CommitsSince(rev string, since time.Time, opts ...CommitsSinceOptions) ([]*Commit, error)\n```\nCommitsSince returns a list of commits since given time. The returned list is in reverse chronological order.\n\n```go\nfunc (r *Repository) CountObjects(opts ...CountObjectsOptions) (*CountObject, error)\n```\nCountObjects returns disk usage report of the repository.\n\n```go\nfunc (r *Repository) CreateTag(name, rev string, opts ...CreateTagOptions) error\n```\nCreateTag creates a new tag on given revision.\n\n```go\nfunc (r *Repository) DeleteBranch(name string, opts ...DeleteBranchOptions) error\n```\nDeleteBranch deletes the branch from the repository.\n\n```go\nfunc (r *Repository) DeleteTag(name string, opts ...DeleteTagOptions) error\n```\nDeleteTag deletes a tag from the repository.\n\n```go\nfunc (r *Repository) Diff(rev string, maxFiles, maxFileLines, maxLineChars int, opts ...DiffOptions) (*Diff, error)\n```\nDiff returns a parsed diff object between given commits of the repository.\n\n```go\nfunc (r *Repository) DiffBinary(base, head string, opts ...DiffBinaryOptions) ([]byte, error)\n```\nDiffBinary returns binary patch between base and head revisions that could be used for git-apply.\n\n```go\nfunc (r *Repository) DiffNameOnly(base, head string, opts ...DiffNameOnlyOptions) ([]string, error)\n```\nDiffNameOnly returns a list of changed files between base and head revisions of the repository.\n\n```go\nfunc (r *Repository) Fetch(opts ...FetchOptions) error\n```\nFetch fetches updates for the repository.\n\n```go\nfunc (r *Repository) Fsck(opts ...FsckOptions) error\n```\nFsck verifies the connectivity and validity of the objects in the database for the repository.\n\n```go\nfunc (r *Repository) Grep(pattern string, opts ...GrepOptions) []*GrepResult\n```\nGrep returns the results of a grep search in the repository.\n\n```go\nfunc (r *Repository) HasBranch(branch string, opts ...ShowRefVerifyOptions) bool\n```\nHasBranch returns true if given branch exists in the repository. The branch must be given in short name e.g. \"master\".\n\n```go\nfunc (r *Repository) HasReference(ref string, opts ...ShowRefVerifyOptions) bool\n```\nHasReference returns true if given reference exists in the repository. The reference must be given in full refspec, e.g. \"refs/heads/master\".\n\n```go\nfunc (r *Repository) HasTag(tag string, opts ...ShowRefVerifyOptions) bool\n```\nHasTag returns true if given tag exists in the repository. The tag must be given in short name e.g. \"v1.0.0\".\n\n```go\nfunc (r *Repository) Hook(dir string, name HookName) (*Hook, error)\n```\nHook returns a Git hook by given name in the repository. Giving empty directory will use the default directory. It returns an os.ErrNotExist if both active and sample hook do not exist.\n\n```go\nfunc (r *Repository) Hooks(dir string) ([]*Hook, error)\n```\nHooks returns a list of Git hooks found in the repository. Giving empty directory will use the default directory. It may return an empty slice when no hooks found.\n\n```go\nfunc (r *Repository) LatestCommitTime(opts ...LatestCommitTimeOptions) (time.Time, error)\n```\nLatestCommitTime returns the time of latest commit of the repository.\n\n```go\nfunc (r *Repository) Log(rev string, opts ...LogOptions) ([]*Commit, error)\n```\nLog returns a list of commits in the state of given revision of the repository. The returned list is in reverse chronological order.\n\n```go\nfunc (r *Repository) LsTree(treeID string, opts ...LsTreeOptions) (*Tree, error)\n```\nLsTree returns the tree object in the repository by given tree ID.\n\n```go\nfunc (r *Repository) MergeBase(base, head string, opts ...MergeBaseOptions) (string, error)\n```\nMergeBase returns merge base between base and head revisions of the repository.\n\n```go\nfunc (r *Repository) Move(src, dst string, opts ...MoveOptions) error\n```\nMove moves a file, a directory, or a symlink file or directory from source to destination for the repository.\n\n```go\nfunc (r *Repository) NewHook(dir string, name HookName) *Hook\n```\nNewHook creates and returns a new hook with given name. Update method must be called to actually save the hook to disk.\n\n```go\nfunc (r *Repository) Path() string\n```\nPath returns the path of the repository.\n\n```go\nfunc (r *Repository) Pull(opts ...PullOptions) error\n```\nPull pulls updates for the repository.\n\n```go\nfunc (r *Repository) Push(remote, branch string, opts ...PushOptions) error\n```\nPush pushes local changes to given remote and branch for the repository.\n\n```go\nfunc (r *Repository) RawDiff(rev string, diffType RawDiffFormat, w io.Writer, opts ...RawDiffOptions) error\n```\nRawDiff dumps diff of repository in given revision directly to given io.Writer.\n\n```go\nfunc (r *Repository) RemoteAdd(name, url string, opts ...RemoteAddOptions) error\n```\nRemoteAdd adds a new remote to the repository.\n\n```go\nfunc (r *Repository) RemoteGetURL(name string, opts ...RemoteGetURLOptions) ([]string, error)\n```\nRemoteGetURL retrieves URL(s) of a remote of the repository in given path.\n\n```go\nfunc (r *Repository) RemoteRemove(name string, opts ...RemoteRemoveOptions) error\n```\nRemoteRemove removes a remote from the repository.\n\n```go\nfunc (r *Repository) RemoteSetURL(name, newurl string, opts ...RemoteSetURLOptions) error\n```\nRemoteSetURL sets the first URL of the remote with given name of the repository.\n\n```go\nfunc (r *Repository) RemoteSetURLAdd(name, newurl string, opts ...RemoteSetURLAddOptions) error\n```\nRemoteSetURLAdd appends an URL to the remote with given name of the repository. Use RemoteSetURL to overwrite the URL(s) instead.\n\n```go\nfunc (r *Repository) RemoteSetURLDelete(name, regex string, opts ...RemoteSetURLDeleteOptions) error\n```\nRemoteSetURLDelete deletes all URLs matching regex of the remote with given name of the repository.\n\n```go\nfunc (r *Repository) Remotes(opts ...RemotesOptions) ([]string, error)\n```\nRemotes lists remotes of the repository.\n\n```go\nfunc (r *Repository) RemoveRemote(name string, opts ...RemoteRemoveOptions) error\n```\nDeprecated: Use RemoteRemove instead.\n\n```go\nfunc (r *Repository) Reset(rev string, opts ...ResetOptions) error\n```\nReset resets working tree to given revision for the repository.\n\n```go\nfunc (r *Repository) RevList(refspecs []string, opts ...RevListOptions) ([]*Commit, error)\n```\nRevList returns a list of commits based on given refspecs in reverse chronological order.\n\n```go\nfunc (r *Repository) RevListCount(refspecs []string, opts ...RevListCountOptions) (int64, error)\n```\nRevListCount returns number of total commits up to given refspec of the repository.\n\n```go\nfunc (r *Repository) RevParse(rev string, opts ...RevParseOptions) (string, error)\n```\nRevParse returns full length (40) commit ID by given revision in the repository.\n\n```go\nfunc (r *Repository) SearchCommits(rev, pattern string, opts ...SearchCommitsOptions) ([]*Commit, error)\n```\nSearchCommits searches commit message with given pattern in the state of given revision. The returned list is in reverse chronological order.\n\n```go\nfunc (r *Repository) ShowNameStatus(rev string, opts ...ShowNameStatusOptions) (*NameStatus, error)\n```\nShowNameStatus returns name status of given revision of the repository.\n\n```go\nfunc (r *Repository) ShowRef(opts ...ShowRefOptions) ([]*Reference, error)\n```\nShowRef returns a list of references in the repository.\n\n```go\nfunc (r *Repository) ShowRefVerify(ref string, opts ...ShowRefVerifyOptions) (string, error)\n```\nShowRefVerify returns the commit ID of given reference (e.g. \"refs/heads/master\") if it exists in the repository.\n\n```go\nfunc (r *Repository) SymbolicRef(opts ...SymbolicRefOptions) (string, error)\n```\nSymbolicRef returns the reference name (e.g. \"refs/heads/master\") pointed by the symbolic ref. It returns an empty string and nil error when doing set operation.\n\n```go\nfunc (r *Repository) Tag(name string, opts ...TagOptions) (*Tag, error)\n```\nTag returns a Git tag by given name, e.g. \"v1.0.0\".\n\n```go\nfunc (r *Repository) TagCommit(tag string, opts ...CatFileCommitOptions) (*Commit, error)\n```\nTagCommit returns the latest commit of given tag of the repository. The tag must be given in short name e.g. \"v1.0.0\".\n\n```go\nfunc (r *Repository) TagCommitID(tag string, opts ...ShowRefVerifyOptions) (string, error)\n```\nTagCommitID returns the commit ID of given tag if it exists in the repository. The tag must be given in short name e.g. \"v1.0.0\".\n\n```go\nfunc (r *Repository) Tags(opts ...TagsOptions) ([]string, error)\n```\nTags returns a list of tags of the repository.\n\n```go\ntype ResetOptions struct {\n\t// Indicates whether to perform a hard reset.\n\tHard bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nResetOptions contains optional arguments for resetting a branch.\n\nDocs: [https://git-scm.com/docs/git-reset](https://git-scm.com/docs/git-reset)\n\n```go\ntype RevListCountOptions struct {\n\t// The relative path of the repository.\n\tPath string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRevListCountOptions contains optional arguments for counting commits.\n\nDocs: [https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---count](https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---count)\n\n```go\ntype RevListOptions struct {\n\t// The relative path of the repository.\n\tPath string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRevListOptions contains optional arguments for listing commits.\n\nDocs: [https://git-scm.com/docs/git-rev-list](https://git-scm.com/docs/git-rev-list)\n\n```go\ntype RevParseOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nRevParseOptions contains optional arguments for parsing revision.\n\nDocs: [https://git-scm.com/docs/git-rev-parse](https://git-scm.com/docs/git-rev-parse)\n\n```go\ntype RunInDirOptions struct {\n\t// Stdin is the input to the command.\n\tStdin io.Reader\n\t// Stdout is the outputs from the command.\n\tStdout io.Writer\n\t// Stderr is the error output from the command.\n\tStderr io.Writer\n\t// Timeout is the duration to wait before timing out.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout or *Command.WithTimeout instead.\n\tTimeout time.Duration\n}\n```\nRunInDirOptions contains options for running a command in a directory.\n\n```go\ntype SHA1 struct {\n\t// contains filtered or unexported fields\n}\n```\nSHA1 is the SHA-1 hash of a Git object.\n\n```go\nfunc MustID(b []byte) *SHA1\n```\nMustID always returns a new SHA1 from a \\[20]byte array with no validation of input.\n\n```go\nfunc MustIDFromString(s string) *SHA1\n```\nMustIDFromString always returns a new sha from a ID with no validation of input.\n\n```go\nfunc NewID(b []byte) (*SHA1, error)\n```\nNewID returns a new SHA1 from a \\[20]byte array.\n\n```go\nfunc NewIDFromString(s string) (*SHA1, error)\n```\nNewIDFromString returns a new SHA1 from a ID string of length 40.\n\n```go\nfunc (s *SHA1) Equal(s2 interface{}) bool\n```\nEqual returns true if s2 has the same SHA1 as s. It supports 40-length-string, \\[]byte, and SHA1.\n\n```go\nfunc (s *SHA1) String() string\n```\nString returns string (hex) representation of the SHA1.\n\n```go\ntype SearchCommitsOptions struct {\n\t// The maximum number of commits to output.\n\tMaxCount int\n\t// The relative path of the repository.\n\tPath string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nSearchCommitsOptions contains optional arguments for searching commits.\n\nDocs: [https://git-scm.com/docs/git-log](https://git-scm.com/docs/git-log)\n\n```go\ntype ShowNameStatusOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nShowNameStatusOptions contains optional arguments for showing name status.\n\nDocs: [https://git-scm.com/docs/git-show#Documentation/git-show.txt---name-status](https://git-scm.com/docs/git-show#Documentation/git-show.txt---name-status)\n\n```go\ntype ShowRefOptions struct {\n\t// Indicates whether to include heads.\n\tHeads bool\n\t// Indicates whether to include tags.\n\tTags bool\n\t// The list of patterns to filter results.\n\tPatterns []string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nShowRefOptions contains optional arguments for listing references.\n\nDocs: [https://git-scm.com/docs/git-show-ref](https://git-scm.com/docs/git-show-ref)\n\n```go\ntype ShowRefVerifyOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nShowRefVerifyOptions contains optional arguments for verifying a reference.\n\nDocs: [https://git-scm.com/docs/git-show-ref#Documentation/git-show-ref.txt---verify](https://git-scm.com/docs/git-show-ref#Documentation/git-show-ref.txt---verify)\n\n```go\ntype Signature struct {\n\t// The name of the person.\n\tName string\n\t// The email address.\n\tEmail string\n\t// The time of the signature.\n\tWhen time.Time\n}\n```\nSignature represents a author or committer.\n\n```go\ntype SteamParseDiffResult struct {\n\tDiff *Diff\n\tErr  error\n}\n```\nSteamParseDiffResult contains results of streaming parsing a diff.\n\n```go\ntype Submodule struct {\n\t// The name of the submodule.\n\tName string\n\t// The URL of the submodule.\n\tURL string\n\t// The commit ID of the subproject.\n\tCommit string\n}\n```\nSubmodule contains information of a Git submodule.\n\n```go\ntype Submodules = *objectCache\n```\nSubmodules contains information of submodules.\n\n```go\ntype SymbolicRefOptions struct {\n\t// The name of the symbolic ref. When not set, default ref \"HEAD\" is used.\n\tName string\n\t// The name of the reference, e.g. \"refs/heads/master\". When set, it will be\n\t// used to update the symbolic ref.\n\tRef string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nSymbolicRefOptions contains optional arguments for get and set symbolic ref.\n\n```go\ntype Tag struct {\n\t// contains filtered or unexported fields\n}\n```\nTag contains information of a Git tag.\n\n```go\nfunc (t *Tag) Commit(opts ...CatFileCommitOptions) (*Commit, error)\n```\nCommit returns the underlying commit of the tag.\n\n```go\nfunc (t *Tag) CommitID() *SHA1\n```\nCommitID returns the commit ID of the tag.\n\n```go\nfunc (t *Tag) ID() *SHA1\n```\nID returns the SHA-1 hash of the tag.\n\n```go\nfunc (t *Tag) Message() string\n```\nMessage returns the message of the tag.\n\n```go\nfunc (t *Tag) Refspec() string\n```\nRefspec returns the refspec of the tag.\n\n```go\nfunc (t *Tag) Tagger() *Signature\n```\nTagger returns the tagger of the tag.\n\n```go\nfunc (t *Tag) Type() ObjectType\n```\nType returns the type of the tag.\n\n```go\ntype TagOptions struct {\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nTagOptions contains optional arguments for getting a tag.\n\nDocs: [https://git-scm.com/docs/git-cat-file](https://git-scm.com/docs/git-cat-file)\n\n```go\ntype TagsOptions struct {\n\t// SortKet sorts tags with provided tag key, optionally prefixed with '-' to sort tags in descending order.\n\tSortKey string\n\t// Pattern filters tags matching the specified pattern.\n\tPattern string\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\t//\n\t// Deprecated: Use CommandOptions.Timeout instead.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nTagsOptions contains optional arguments for listing tags.\n\nDocs: [https://git-scm.com/docs/git-tag#Documentation/git-tag.txt---list](https://git-scm.com/docs/git-tag#Documentation/git-tag.txt---list)\n\n```go\ntype Tree struct {\n\t// contains filtered or unexported fields\n}\n```\nTree represents a flat directory listing in Git.\n\n```go\nfunc (t *Tree) Blob(subpath string, opts ...LsTreeOptions) (*Blob, error)\n```\nBlob returns the blob object by given subpath of the tree.\n\n```go\nfunc (t *Tree) BlobByIndex(index string) (*Blob, error)\n```\nBlobByIndex returns blob object by given index.\n\n```go\nfunc (t *Tree) Entries(opts ...LsTreeOptions) (Entries, error)\n```\nEntries returns all entries of the tree.\n\n```go\nfunc (t *Tree) Subtree(subpath string, opts ...LsTreeOptions) (*Tree, error)\n```\nSubtree returns a subtree by given subpath of the tree.\n\n```go\nfunc (t *Tree) TreeEntry(subpath string, opts ...LsTreeOptions) (*TreeEntry, error)\n```\nTreeEntry returns the TreeEntry by given subpath of the tree.\n\n```go\ntype TreeEntry struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (e *TreeEntry) Blob() *Blob\n```\nBlob returns a blob object from the entry.\n\n```go\nfunc (e *TreeEntry) ID() *SHA1\n```\nID returns the SHA-1 hash of the entry.\n\n```go\nfunc (e *TreeEntry) IsBlob() bool\n```\nIsBlob returns true if the entry is a blob.\n\n```go\nfunc (e *TreeEntry) IsCommit() bool\n```\nIsCommit returns true if the entry is a commit (i.e. a submodule).\n\n```go\nfunc (e *TreeEntry) IsExec() bool\n```\nIsExec returns tree if the entry is an executable.\n\n```go\nfunc (e *TreeEntry) IsSymlink() bool\n```\nIsSymlink returns true if the entry is a symbolic link.\n\n```go\nfunc (e *TreeEntry) IsTree() bool\n```\nIsTree returns tree if the entry itself is another tree (i.e. a directory).\n\n```go\nfunc (e *TreeEntry) Mode() EntryMode\n```\nMode returns the entry mode if the tree entry.\n\n```go\nfunc (e *TreeEntry) Name() string\n```\nName returns name of the entry.\n\n```go\nfunc (e *TreeEntry) Size() int64\n```\nSize returns the size of thr entry.\n\n```go\nfunc (e *TreeEntry) Type() ObjectType\n```\nType returns the object type of the entry.\n\n```go\ntype UpdateServerInfoOptions struct {\n\t// Indicates whether to overwrite the existing server info.\n\tForce bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nUpdateServerInfoOptions contains optional arguments for updating auxiliary info file on the server side.\n\nDocs: [https://git-scm.com/docs/git-update-server-info](https://git-scm.com/docs/git-update-server-info)\n\n```go\ntype UploadPackOptions struct {\n\t// Indicates whether to quit after a single request/response exchange.\n\tStatelessRPC bool\n\t// Indicates whether to not try \"\u003cdirectory\u003e/.git/\" if \"\u003cdirectory\u003e\" is not a\n\t// Git directory.\n\tStrict bool\n\t// Indicates whether to generate the \"info/refs\" used by the \"git http-backend\".\n\tHTTPBackendInfoRefs bool\n\t// The timeout duration before giving up for each shell command execution. The\n\t// default timeout duration will be used when not supplied.\n\tTimeout time.Duration\n\t// The additional options to be passed to the underlying git.\n\tCommandOptions\n}\n```\nUploadPackOptions contains optional arguments for sending the packfile to the client.\n\nDocs: [https://git-scm.com/docs/git-upload-pack](https://git-scm.com/docs/git-upload-pack)\n\n","path":"github.com/gogs/git-module","name":"git","synopsis":"","isRedistributable":true}
