{"modulePath":"github.com/RedAFD/code-core","version":"v1.14.0-rc8","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git\n\n## Constants\n\n```go\nconst BranchPrefix = \"refs/heads/\"\n```\nBranchPrefix base dir of the branch information file store on git\n\n```go\nconst DefaultLocale = \"C\"\n```\nDefaultLocale is the default LC\\_ALL to run git commands in.\n\n```go\nconst EmptySHA = \"0000000000000000000000000000000000000000\"\n```\nEmptySHA defines empty git SHA\n\n```go\nconst EmptyTreeSHA = \"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"\n```\nEmptyTreeSHA is the SHA of an empty tree\n\n```go\nconst (\n\t// GitTimeLayout is the (default) time layout used by git.\n\tGitTimeLayout = \"Mon Jan _2 15:04:05 2006 -0700\"\n)\n```\n\n```go\nconst (\n\t// HookPathUpdate hook update path\n\tHookPathUpdate = \"hooks/update\"\n)\n```\n\n```go\nconst NotesRef = \"refs/notes/commits\"\n```\nNotesRef is the git ref where Gitea will look for git-notes data. The value (\"refs/notes/commits\") is the default ref used by git-notes.\n\n```go\nconst TagPrefix = \"refs/tags/\"\n```\nTagPrefix tags prefix path on the repository\n\n## Variables\n\n```go\nvar (\n\t// GlobalCommandArgs global command args for external package setting\n\tGlobalCommandArgs []string\n\n\t// DefaultCommandExecutionTimeout default command execution timeout duration\n\tDefaultCommandExecutionTimeout = 360 * time.Second\n)\n```\n\n```go\nvar (\n\t// Debug enables verbose logging on everything.\n\t// This should be false in case Gogs starts in SSH mode.\n\tDebug = false\n\t// Prefix the log prefix\n\tPrefix = \"[git-module] \"\n\t// GitVersionRequired is the minimum Git version required\n\tGitVersionRequired = \"1.7.2\"\n\n\t// GitExecutable is the command name of git\n\t// Could be updated to an absolute path while initialization\n\tGitExecutable = \"git\"\n\n\t// DefaultContext is the default context to run git commands in\n\t// will be overwritten by Init with HammerContext\n\tDefaultContext = context.Background()\n)\n```\n\n```go\nvar BranchesRangeSize = 20\n```\nBranchesRangeSize the default branches range size\n\n```go\nvar CommitsRangeSize = 50\n```\nCommitsRangeSize the default commits range size\n\n```go\nvar (\n\t// ErrNotValidHook error when a git hook is not valid\n\tErrNotValidHook = errors.New(\"not a valid Git hook\")\n)\n```\n\n```go\nvar SHAPattern = regexp.MustCompile(`^[0-9a-f]{4,40}$`)\n```\nSHAPattern can be used to determine if a string is an valid sha\n\n## Functions\n\n```go\nfunc AddChanges(repoPath string, all bool, files ...string) error\n```\nAddChanges marks local changes to be ready for commit.\n\n```go\nfunc AddChangesWithArgs(repoPath string, gloablArgs []string, all bool, files ...string) error\n```\nAddChangesWithArgs marks local changes to be ready for commit.\n\n```go\nfunc AllCommitsCount(repoPath string, hidePRRefs bool, files ...string) (int64, error)\n```\nAllCommitsCount returns count of all commits in repository\n\n```go\nfunc CatFileBatch(repoPath string) (*io.PipeWriter, *bufio.Reader, func())\n```\nCatFileBatch opens git cat-file --batch in the provided repo and returns a stdin pipe, a stdout reader and cancel function\n\n```go\nfunc CheckGitVersionAtLeast(atLeast string) error\n```\nCheckGitVersionAtLeast check git version is at least the constraint version\n\n```go\nfunc Checkout(repoPath string, opts CheckoutOptions) error\n```\nCheckout checkouts a branch\n\n```go\nfunc Clone(from, to string, opts CloneRepoOptions) (err error)\n```\nClone clones original repository to target path.\n\n```go\nfunc CloneWithArgs(ctx context.Context, from, to string, args []string, opts CloneRepoOptions) (err error)\n```\nCloneWithArgs original repository to target path.\n\n```go\nfunc CloneWithContext(ctx context.Context, from, to string, opts CloneRepoOptions) (err error)\n```\nCloneWithContext clones original repository to target path.\n\n```go\nfunc CommitChanges(repoPath string, opts CommitChangesOptions) error\n```\nCommitChanges commits local changes with given committer, author and message. If author is nil, it will be the same as committer.\n\n```go\nfunc CommitChangesWithArgs(repoPath string, args []string, opts CommitChangesOptions) error\n```\nCommitChangesWithArgs commits local changes with given committer, author and message. If author is nil, it will be the same as committer.\n\n```go\nfunc CommitsCount(repoPath string, revision ...string) (int64, error)\n```\nCommitsCount returns number of total commits of until given revision.\n\n```go\nfunc CommitsCountFiles(repoPath string, revision, relpath []string) (int64, error)\n```\nCommitsCountFiles returns number of total commits of until given revision.\n\n```go\nfunc ConcatenateError(err error, stderr string) error\n```\nConcatenateError concatenats an error with stderr string\n\n```go\nfunc CutDiffAroundLine(originalDiff io.Reader, line int64, old bool, numbersOfLine int) (string, error)\n```\nCutDiffAroundLine cuts a diff of a file in way that only the given line + numberOfLine above it will be shown it also recalculates hunks and adds the appropriate headers to the new diff. Warning: Only one-file diffs are allowed.\n\n```go\nfunc Fsck(ctx context.Context, repoPath string, timeout time.Duration, args ...string) error\n```\nFsck verifies the connectivity and validity of the objects in the database\n\n```go\nfunc GetDiffShortStat(repoPath string, args ...string) (numFiles, totalAdditions, totalDeletions int, err error)\n```\nGetDiffShortStat counts number of changed files, number of additions and deletions\n\n```go\nfunc GetFullCommitID(repoPath, shortID string) (string, error)\n```\nGetFullCommitID returns full length (40) of commit ID by given short SHA in a repository.\n\n```go\nfunc GetLatestCommitTime(repoPath string) (time.Time, error)\n```\nGetLatestCommitTime returns time for latest commit in repository (across all branches)\n\n```go\nfunc GetNote(repo *Repository, commitID string, note *Note) error\n```\nGetNote retrieves the git-notes data for a given commit.\n\n```go\nfunc GetRawDiff(repoPath, commitID string, diffType RawDiffType, writer io.Writer) error\n```\nGetRawDiff dumps diff results of repository in given commit ID to io.Writer.\n\n```go\nfunc GetRawDiffForFile(repoPath, startCommit, endCommit string, diffType RawDiffType, file string, writer io.Writer) error\n```\nGetRawDiffForFile dumps diff results of file in given commit ID to io.Writer.\n\n```go\nfunc GetRepoRawDiffForFile(repo *Repository, startCommit, endCommit string, diffType RawDiffType, file string, writer io.Writer) error\n```\nGetRepoRawDiffForFile dumps diff results of file in given commit ID to io.Writer according given repository\n\n```go\nfunc Init(ctx context.Context) error\n```\nInit initializes git module\n\n```go\nfunc InitRepository(repoPath string, bare bool) error\n```\nInitRepository initializes a new Git repository.\n\n```go\nfunc IsBranchExist(repoPath, name string) bool\n```\nIsBranchExist returns true if given branch exists in the repository.\n\n```go\nfunc IsErrBadLink(err error) bool\n```\nIsErrBadLink if some error is ErrBadLink\n\n```go\nfunc IsErrBranchNotExist(err error) bool\n```\nIsErrBranchNotExist checks if an error is a ErrBranchNotExist.\n\n```go\nfunc IsErrExecTimeout(err error) bool\n```\nIsErrExecTimeout if some error is ErrExecTimeout\n\n```go\nfunc IsErrNotExist(err error) bool\n```\nIsErrNotExist if some error is ErrNotExist\n\n```go\nfunc IsErrPushOutOfDate(err error) bool\n```\nIsErrPushOutOfDate checks if an error is a ErrPushOutOfDate.\n\n```go\nfunc IsErrPushRejected(err error) bool\n```\nIsErrPushRejected checks if an error is a ErrPushRejected.\n\n```go\nfunc IsErrUnsupportedVersion(err error) bool\n```\nIsErrUnsupportedVersion if some error is ErrUnsupportedVersion\n\n```go\nfunc IsReferenceExist(repoPath, name string) bool\n```\nIsReferenceExist returns true if given reference exists in the repository.\n\n```go\nfunc IsRepoURLAccessible(url string) bool\n```\nIsRepoURLAccessible checks if given repository URL is accessible.\n\n```go\nfunc IsTagExist(repoPath, name string) bool\n```\nIsTagExist returns true if given tag exists in the repository.\n\n```go\nfunc IsValidHookName(name string) bool\n```\nIsValidHookName returns true if given name is a valid Git hook.\n\n```go\nfunc LoadGitVersion() error\n```\nLoadGitVersion returns current Git version from shell.\n\n```go\nfunc LocalVersion() (*version.Version, error)\n```\nLocalVersion returns current Git version from shell.\n\n```go\nfunc MoveFile(repoPath, oldTreeName, newTreeName string) error\n```\nMoveFile moves a file to another file or directory.\n\n```go\nfunc ParseBool(value string) (result bool, valid bool)\n```\nParseBool returns the boolean value represented by the string as per git's git\\_config\\_bool true will be returned for the result if the string is empty, but valid will be false. \"true\", \"yes\", \"on\" are all true, true \"false\", \"no\", \"off\" are all false, true 0 is false, true Any other integer is true, true Anything else will return false, false\n\n```go\nfunc ParseDiffHunkString(diffhunk string) (leftLine, leftHunk, rightLine, righHunk int)\n```\nParseDiffHunkString parse the diffhunk content and return\n\n```go\nfunc ParseTreeLine(rd *bufio.Reader, modeBuf, fnameBuf, shaBuf []byte) (mode, fname, sha []byte, n int, err error)\n```\nParseTreeLine reads an entry from a tree in a cat-file --batch stream This carefully avoids allocations - except where fnameBuf is too small. It is recommended therefore to pass in an fnameBuf large enough to avoid almost all allocations\n\nEach line is composed of: \\\u003cmode-in-ascii-dropping-initial-zeros\u003e SP \\\u003cfname\u003e NUL \\\u003c20-byte SHA\u003e\n\nWe don't attempt to convert the 20-byte SHA to 40-byte SHA to save a lot of time\n\n```go\nfunc ParseTreeLineSkipMode(rd *bufio.Reader, fnameBuf, shaBuf []byte) (fname, sha []byte, n int, err error)\n```\nParseTreeLineSkipMode reads an entry from a tree in a cat-file --batch stream This simply skips the mode - saving a substantial amount of time and carefully avoids allocations - except where fnameBuf is too small. It is recommended therefore to pass in an fnameBuf large enough to avoid almost all allocations\n\nEach line is composed of: \\\u003cmode-in-ascii-dropping-initial-zeros\u003e SP \\\u003cfname\u003e NUL \\\u003c20-byte SHA\u003e\n\nWe don't attempt to convert the 20-byte SHA to 40-byte SHA to save a lot of time\n\n```go\nfunc Pull(repoPath string, opts PullRemoteOptions) error\n```\nPull pulls changes from remotes.\n\n```go\nfunc Push(repoPath string, opts PushOptions) error\n```\nPush pushs local commits to given remote branch.\n\n```go\nfunc ReadBatchLine(rd *bufio.Reader) (sha []byte, typ string, size int64, err error)\n```\nReadBatchLine reads the header line from cat-file --batch We expect: \\\u003csha\u003e SP \\\u003ctype\u003e SP \\\u003csize\u003e LF\n\n```go\nfunc ReadTagObjectID(rd *bufio.Reader, size int64) (string, error)\n```\nReadTagObjectID reads a tag object ID hash from a cat-file --batch stream, throwing away the rest of the stream.\n\n```go\nfunc ReadTreeID(rd *bufio.Reader, size int64) (string, error)\n```\nReadTreeID reads a tree ID from a cat-file --batch stream, throwing away the rest of the stream.\n\n```go\nfunc RefEndName(refStr string) string\n```\nRefEndName return the end name of a ref name\n\n```go\nfunc RefURL(repoURL, ref string) string\n```\nRefURL returns the absolute URL for a ref in a repository\n\n```go\nfunc ResetHEAD(repoPath string, hard bool, revision string) error\n```\nResetHEAD resets HEAD to given revision or head of branch.\n\n```go\nfunc SetExecutablePath(path string) error\n```\nSetExecutablePath changes the path of git executable and checks the file permission and version.\n\n```go\nfunc SetUpdateHook(repoPath, content string) (err error)\n```\nSetUpdateHook writes given content to update hook of the repository.\n\n```go\nfunc SplitRefName(refStr string) (string, string)\n```\nSplitRefName splits a full refname to reftype and simple refname\n\n## Types\n\n```go\ntype ArchiveType int\n```\nArchiveType archive types\n\n```go\nconst (\n\t// ZIP zip archive type\n\tZIP ArchiveType = iota + 1\n\t// TARGZ tar gz archive type\n\tTARGZ\n)\n```\n\n```go\nfunc (a ArchiveType) String() string\n```\nString converts an ArchiveType to string\n\n```go\ntype BlamePart struct {\n\tSha   string\n\tLines []string\n}\n```\nBlamePart represents block of blame - continuous lines with one sha\n\n```go\ntype BlameReader struct {\n\t// contains filtered or unexported fields\n}\n```\nBlameReader returns part of file blame one by one\n\n```go\nfunc CreateBlameReader(ctx context.Context, repoPath, commitID, file string) (*BlameReader, error)\n```\nCreateBlameReader creates reader for given repository, commit and file\n\n```go\nfunc (r *BlameReader) Close() error\n```\nClose BlameReader - don't run NextPart after invoking that\n\n```go\nfunc (r *BlameReader) NextPart() (*BlamePart, error)\n```\nNextPart returns next part of blame (sequencial code lines with the same commit)\n\n```go\ntype Blob struct {\n\tID SHA1\n\t// contains filtered or unexported fields\n}\n```\nBlob represents a Git object.\n\n```go\nfunc (b *Blob) DataAsync() (io.ReadCloser, error)\n```\nDataAsync gets a ReadCloser for the contents of a blob without reading it all. Calling the Close function on the result will discard all unread output.\n\n```go\nfunc (b *Blob) GetBlobContent() (string, error)\n```\nGetBlobContent Gets the content of the blob as raw text\n\n```go\nfunc (b *Blob) GetBlobContentBase64() (string, error)\n```\nGetBlobContentBase64 Reads the content of the blob with a base64 encode and returns the encoded string\n\n```go\nfunc (b *Blob) GetBlobLineCount() (int, error)\n```\nGetBlobLineCount gets line count of lob as raw text\n\n```go\nfunc (b *Blob) Name() string\n```\nName returns name of the tree entry this blob object was created from (or empty string)\n\n```go\nfunc (b *Blob) Size() int64\n```\nSize returns the uncompressed size of the blob\n\n```go\ntype Branch struct {\n\tName string\n\tPath string\n\t// contains filtered or unexported fields\n}\n```\nBranch represents a Git branch.\n\n```go\nfunc GetBranchesByPath(path string, skip, limit int) ([]*Branch, int, error)\n```\nGetBranchesByPath returns a branch by it's path if limit = 0 it will not limit\n\n```go\nfunc (branch *Branch) GetCommit() (*Commit, error)\n```\nGetCommit returns the head commit of a branch\n\n```go\ntype Cache interface {\n\t// Put puts value into cache with key and expire time.\n\tPut(key string, val interface{}, timeout int64) error\n\t// Get gets cached value by given key.\n\tGet(key string) interface{}\n}\n```\nCache represents a caching interface\n\n```go\ntype CheckAttributeOpts struct {\n\tCachedOnly    bool\n\tAllAttributes bool\n\tAttributes    []string\n\tFilenames     []string\n}\n```\nCheckAttributeOpts represents the possible options to CheckAttribute\n\n```go\ntype CheckoutOptions struct {\n\tTimeout   time.Duration\n\tBranch    string\n\tOldBranch string\n}\n```\nCheckoutOptions options when heck out some branch\n\n```go\ntype CloneRepoOptions struct {\n\tTimeout    time.Duration\n\tMirror     bool\n\tBare       bool\n\tQuiet      bool\n\tBranch     string\n\tShared     bool\n\tNoCheckout bool\n\tDepth      int\n}\n```\nCloneRepoOptions options when clone a repository\n\n```go\ntype CodeActivityAuthor struct {\n\tName    string\n\tEmail   string\n\tCommits int64\n}\n```\nCodeActivityAuthor represents git statistics data for commit authors\n\n```go\ntype CodeActivityStats struct {\n\tAuthorCount              int64\n\tCommitCount              int64\n\tChangedFiles             int64\n\tAdditions                int64\n\tDeletions                int64\n\tCommitCountInAllBranches int64\n\tAuthors                  []*CodeActivityAuthor\n}\n```\nCodeActivityStats represents git statistics data\n\n```go\ntype Command struct {\n\t// contains filtered or unexported fields\n}\n```\nCommand represents a command with its subcommands or arguments.\n\n```go\nfunc NewCommand(args ...string) *Command\n```\nNewCommand creates and returns a new Git Command based on given command and arguments.\n\n```go\nfunc NewCommandContext(ctx context.Context, args ...string) *Command\n```\nNewCommandContext creates and returns a new Git Command based on given command and arguments.\n\n```go\nfunc NewCommandContextNoGlobals(ctx context.Context, args ...string) *Command\n```\nNewCommandContextNoGlobals creates and returns a new Git Command based on given command and arguments only with the specify args and don't care global command args\n\n```go\nfunc NewCommandNoGlobals(args ...string) *Command\n```\nNewCommandNoGlobals creates and returns a new Git Command based on given command and arguments only with the specify args and don't care global command args\n\n```go\nfunc (c *Command) AddArguments(args ...string) *Command\n```\nAddArguments adds new argument(s) to the command.\n\n```go\nfunc (c *Command) Run() (string, error)\n```\nRun executes the command in default working directory and returns stdout in string and error (combined with stderr).\n\n```go\nfunc (c *Command) RunInDir(dir string) (string, error)\n```\nRunInDir executes the command in given directory and returns stdout in string and error (combined with stderr).\n\n```go\nfunc (c *Command) RunInDirBytes(dir string) ([]byte, error)\n```\nRunInDirBytes executes the command in given directory and returns stdout in \\[]byte and error (combined with stderr).\n\n```go\nfunc (c *Command) RunInDirFullPipeline(dir string, stdout, stderr io.Writer, stdin io.Reader) error\n```\nRunInDirFullPipeline executes the command in given directory, it pipes stdout and stderr to given io.Writer.\n\n```go\nfunc (c *Command) RunInDirPipeline(dir string, stdout, stderr io.Writer) error\n```\nRunInDirPipeline executes the command in given directory, it pipes stdout and stderr to given io.Writer.\n\n```go\nfunc (c *Command) RunInDirTimeout(timeout time.Duration, dir string) ([]byte, error)\n```\nRunInDirTimeout executes the command in given directory with given timeout, and returns stdout in \\[]byte and error (combined with stderr).\n\n```go\nfunc (c *Command) RunInDirTimeoutEnv(env []string, timeout time.Duration, dir string) ([]byte, error)\n```\nRunInDirTimeoutEnv executes the command in given directory with given timeout, and returns stdout in \\[]byte and error (combined with stderr).\n\n```go\nfunc (c *Command) RunInDirTimeoutEnvFullPipeline(env []string, timeout time.Duration, dir string, stdout, stderr io.Writer, stdin io.Reader) error\n```\nRunInDirTimeoutEnvFullPipeline executes the command in given directory with given timeout, it pipes stdout and stderr to given io.Writer and passes in an io.Reader as stdin.\n\n```go\nfunc (c *Command) RunInDirTimeoutEnvFullPipelineFunc(env []string, timeout time.Duration, dir string, stdout, stderr io.Writer, stdin io.Reader, fn func(context.Context, context.CancelFunc) error) error\n```\nRunInDirTimeoutEnvFullPipelineFunc executes the command in given directory with given timeout, it pipes stdout and stderr to given io.Writer and passes in an io.Reader as stdin. Between cmd.Start and cmd.Wait the passed in function is run.\n\n```go\nfunc (c *Command) RunInDirTimeoutEnvPipeline(env []string, timeout time.Duration, dir string, stdout, stderr io.Writer) error\n```\nRunInDirTimeoutEnvPipeline executes the command in given directory with given timeout, it pipes stdout and stderr to given io.Writer.\n\n```go\nfunc (c *Command) RunInDirTimeoutFullPipeline(timeout time.Duration, dir string, stdout, stderr io.Writer, stdin io.Reader) error\n```\nRunInDirTimeoutFullPipeline executes the command in given directory with given timeout, it pipes stdout and stderr to given io.Writer, and stdin from the given io.Reader\n\n```go\nfunc (c *Command) RunInDirTimeoutPipeline(timeout time.Duration, dir string, stdout, stderr io.Writer) error\n```\nRunInDirTimeoutPipeline executes the command in given directory with given timeout, it pipes stdout and stderr to given io.Writer.\n\n```go\nfunc (c *Command) RunInDirWithEnv(dir string, env []string) (string, error)\n```\nRunInDirWithEnv executes the command in given directory and returns stdout in string and error (combined with stderr).\n\n```go\nfunc (c *Command) RunTimeout(timeout time.Duration) (string, error)\n```\nRunTimeout executes the command in default working directory with given timeout, and returns stdout in string and error (combined with stderr).\n\n```go\nfunc (c *Command) SetDescription(desc string) *Command\n```\nSetDescription sets the description for this command which be returned on c.String()\n\n```go\nfunc (c *Command) SetParentContext(ctx context.Context) *Command\n```\nSetParentContext sets the parent context for this command\n\n```go\nfunc (c *Command) String() string\n```\n\n```go\ntype Commit struct {\n\tBranch string // Branch this commit belongs to\n\tTree\n\tID            SHA1 // The ID of this commit object\n\tAuthor        *Signature\n\tCommitter     *Signature\n\tCommitMessage string\n\tSignature     *CommitGPGSignature\n\n\tParents []SHA1 // SHA1 strings\n\t// contains filtered or unexported fields\n}\n```\nCommit represents a git commit.\n\n```go\nfunc CommitFromReader(gitRepo *Repository, sha SHA1, reader io.Reader) (*Commit, error)\n```\nCommitFromReader will generate a Commit from a provided reader We need this to interpret commits from cat-file or cat-file --batch\n\nIf used as part of a cat-file --batch stream you need to limit the reader to the correct size\n\n```go\nfunc GetLastCommitForPaths(commit *Commit, treePath string, paths []string) ([]*Commit, error)\n```\nGetLastCommitForPaths returns last commit information\n\n```go\nfunc (c *Commit) CommitsBefore() (*list.List, error)\n```\nCommitsBefore returns all the commits before current revision\n\n```go\nfunc (c *Commit) CommitsBeforeLimit(num int) (*list.List, error)\n```\nCommitsBeforeLimit returns num commits before current revision\n\n```go\nfunc (c *Commit) CommitsBeforeUntil(commitID string) (*list.List, error)\n```\nCommitsBeforeUntil returns the commits between commitID to current revision\n\n```go\nfunc (c *Commit) CommitsByRange(page, pageSize int) (*list.List, error)\n```\nCommitsByRange returns the specific page commits before current revision, every page's number default by CommitsRangeSize\n\n```go\nfunc (c *Commit) CommitsCount() (int64, error)\n```\nCommitsCount returns number of total commits of until current revision.\n\n```go\nfunc (c *Commit) CreateArchive(ctx context.Context, target string, opts CreateArchiveOpts) error\n```\nCreateArchive create archive content to the target path\n\n```go\nfunc (c *Commit) FileChangedSinceCommit(filename, pastCommit string) (bool, error)\n```\nFileChangedSinceCommit Returns true if the file given has changed since the the past commit YOU MUST ENSURE THAT pastCommit is a valid commit ID.\n\n```go\nfunc (c *Commit) GetBranchName() (string, error)\n```\nGetBranchName gets the closest branch name (as returned by 'git name-rev --name-only')\n\n```go\nfunc (c *Commit) GetCommitByPath(relpath string) (*Commit, error)\n```\nGetCommitByPath return the commit of relative path object.\n\n```go\nfunc (c *Commit) GetFilesChangedSinceCommit(pastCommit string) ([]string, error)\n```\nGetFilesChangedSinceCommit get all changed file names between pastCommit to current revision\n\n```go\nfunc (c *Commit) GetRepositoryDefaultPublicGPGKey(forceUpdate bool) (*GPGSettings, error)\n```\nGetRepositoryDefaultPublicGPGKey returns the default public key for this commit\n\n```go\nfunc (c *Commit) GetSubModule(entryname string) (*SubModule, error)\n```\nGetSubModule get the sub module according entryname\n\n```go\nfunc (c *Commit) GetSubModules() (*ObjectCache, error)\n```\nGetSubModules get all the sub modules of current revision git tree\n\n```go\nfunc (c *Commit) GetTagName() (string, error)\n```\nGetTagName gets the current tag name for given commit\n\n```go\nfunc (c *Commit) HasFile(filename string) (bool, error)\n```\nHasFile returns true if the file given exists on this commit This does only mean it's there - it does not mean the file was changed during the commit.\n\n```go\nfunc (c *Commit) HasPreviousCommit(commitHash SHA1) (bool, error)\n```\nHasPreviousCommit returns true if a given commitHash is contained in commit's parents\n\n```go\nfunc (c *Commit) ImageInfo(name string) (*ImageMetaData, error)\n```\nImageInfo returns information about the dimensions of an image\n\n```go\nfunc (c *Commit) IsImageFile(name string) bool\n```\nIsImageFile is a file image type\n\n```go\nfunc (c *Commit) LoadBranchName() (err error)\n```\nLoadBranchName load branch name for commit\n\n```go\nfunc (c *Commit) Message() string\n```\nMessage returns the commit message. Same as retrieving CommitMessage directly.\n\n```go\nfunc (c *Commit) Parent(n int) (*Commit, error)\n```\nParent returns n-th parent (0-based index) of the commit.\n\n```go\nfunc (c *Commit) ParentCount() int\n```\nParentCount returns number of parents of the commit. 0 if this is the root commit,  otherwise 1,2, etc.\n\n```go\nfunc (c *Commit) ParentID(n int) (SHA1, error)\n```\nParentID returns oid of n-th parent (0-based index). It returns nil if no such parent exists.\n\n```go\nfunc (c *Commit) SearchCommits(opts SearchCommitsOptions) (*list.List, error)\n```\nSearchCommits returns the commits match the keyword before current revision\n\n```go\nfunc (c *Commit) Summary() string\n```\nSummary returns first line of commit message.\n\n```go\ntype CommitChangesOptions struct {\n\tCommitter *Signature\n\tAuthor    *Signature\n\tMessage   string\n}\n```\nCommitChangesOptions the options when a commit created\n\n```go\ntype CommitFileStatus struct {\n\tAdded    []string\n\tRemoved  []string\n\tModified []string\n}\n```\nCommitFileStatus represents status of files in a commit.\n\n```go\nfunc GetCommitFileStatus(repoPath, commitID string) (*CommitFileStatus, error)\n```\nGetCommitFileStatus returns file status of commit in given repository.\n\n```go\nfunc NewCommitFileStatus() *CommitFileStatus\n```\nNewCommitFileStatus creates a CommitFileStatus\n\n```go\ntype CommitGPGSignature struct {\n\tSignature string\n\tPayload   string //TODO check if can be reconstruct from the rest of commit information to not have duplicate data\n}\n```\nCommitGPGSignature represents a git commit signature part.\n\n```go\ntype CommitInfo struct {\n\tEntry         *TreeEntry\n\tCommit        *Commit\n\tSubModuleFile *SubModuleFile\n}\n```\nCommitInfo describes the first commit with the provided entry\n\n```go\ntype CommitTreeOpts struct {\n\tParents    []string\n\tMessage    string\n\tKeyID      string\n\tNoGPGSign  bool\n\tAlwaysSign bool\n}\n```\nCommitTreeOpts represents the possible options to CommitTree\n\n```go\ntype CompareInfo struct {\n\tMergeBase    string\n\tBaseCommitID string\n\tHeadCommitID string\n\tCommits      *list.List\n\tNumFiles     int\n}\n```\nCompareInfo represents needed information for comparing references.\n\n```go\ntype CountObject struct {\n\tCount       int64\n\tSize        int64\n\tInPack      int64\n\tPacks       int64\n\tSizePack    int64\n\tPrunePack   int64\n\tGarbage     int64\n\tSizeGarbage int64\n}\n```\nCountObject represents repository count objects report\n\n```go\nfunc CountObjects(repoPath string) (*CountObject, error)\n```\nCountObjects returns the results of git count-objects on the repoPath\n\n```go\ntype CreateArchiveOpts struct {\n\tFormat ArchiveType\n\tPrefix bool\n}\n```\nCreateArchiveOpts represents options for creating an archive\n\n```go\ntype DeleteBranchOptions struct {\n\tForce bool\n}\n```\nDeleteBranchOptions Option(s) for delete branch\n\n```go\ntype DivergeObject struct {\n\tAhead  int\n\tBehind int\n}\n```\nDivergeObject represents commit count diverging commits\n\n```go\nfunc GetDivergingCommits(repoPath string, baseBranch string, targetBranch string) (DivergeObject, error)\n```\nGetDivergingCommits returns the number of commits a targetBranch is ahead or behind a baseBranch\n\n```go\ntype Entries []*TreeEntry\n```\nEntries a list of entry\n\n```go\nfunc (tes Entries) CustomSort(cmp func(s1, s2 string) bool)\n```\nCustomSort customizable string comparing sort entry list\n\n```go\nfunc (tes Entries) GetCommitsInfo(commit *Commit, treePath string, cache *LastCommitCache) ([]CommitInfo, *Commit, error)\n```\nGetCommitsInfo gets information of all commits that are corresponding to these entries\n\n```go\nfunc (tes Entries) Sort()\n```\nSort sort the list of entry\n\n```go\ntype EntryMode int\n```\nEntryMode the type of the object in the git tree\n\n```go\nconst (\n\t// EntryModeBlob\n\tEntryModeBlob EntryMode = 0100644\n\t// EntryModeExec\n\tEntryModeExec EntryMode = 0100755\n\t// EntryModeSymlink\n\tEntryModeSymlink EntryMode = 0120000\n\t// EntryModeCommit\n\tEntryModeCommit EntryMode = 0160000\n\t// EntryModeTree\n\tEntryModeTree EntryMode = 0040000\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\nfunc ToEntryMode(value string) EntryMode\n```\nToEntryMode converts a string to an EntryMode\n\n```go\nfunc (e EntryMode) String() string\n```\nString converts an EntryMode to a string\n\n```go\ntype ErrBadLink struct {\n\tName    string\n\tMessage string\n}\n```\nErrBadLink entry.FollowLink error\n\n```go\nfunc (err ErrBadLink) Error() string\n```\n\n```go\ntype ErrBranchNotExist struct {\n\tName string\n}\n```\nErrBranchNotExist represents a \"BranchNotExist\" kind of error.\n\n```go\nfunc (err ErrBranchNotExist) Error() string\n```\n\n```go\ntype ErrExecTimeout struct {\n\tDuration time.Duration\n}\n```\nErrExecTimeout error when exec timed out\n\n```go\nfunc (err ErrExecTimeout) Error() string\n```\n\n```go\ntype ErrNotExist struct {\n\tID      string\n\tRelPath string\n}\n```\nErrNotExist commit not exist error\n\n```go\nfunc (err ErrNotExist) Error() string\n```\n\n```go\ntype ErrPushOutOfDate struct {\n\tStdOut string\n\tStdErr string\n\tErr    error\n}\n```\nErrPushOutOfDate represents an error if merging fails due to unrelated histories\n\n```go\nfunc (err *ErrPushOutOfDate) Error() string\n```\n\n```go\nfunc (err *ErrPushOutOfDate) Unwrap() error\n```\nUnwrap unwraps the underlying error\n\n```go\ntype ErrPushRejected struct {\n\tMessage string\n\tStdOut  string\n\tStdErr  string\n\tErr     error\n}\n```\nErrPushRejected represents an error if merging fails due to rejection from a hook\n\n```go\nfunc (err *ErrPushRejected) Error() string\n```\n\n```go\nfunc (err *ErrPushRejected) GenerateMessage()\n```\nGenerateMessage generates the remote message from the stderr\n\n```go\nfunc (err *ErrPushRejected) Unwrap() error\n```\nUnwrap unwraps the underlying error\n\n```go\ntype ErrUnsupportedVersion struct {\n\tRequired string\n}\n```\nErrUnsupportedVersion error when required git version not matched\n\n```go\nfunc (err ErrUnsupportedVersion) Error() string\n```\n\n```go\ntype GPGSettings struct {\n\tSign             bool\n\tKeyID            string\n\tEmail            string\n\tName             string\n\tPublicKeyContent string\n}\n```\nGPGSettings represents the default GPG settings for this repository\n\n```go\nfunc (gpgSettings *GPGSettings) LoadPublicKeyContent() error\n```\nLoadPublicKeyContent will load the key from gpg\n\n```go\ntype Hasher struct {\n\thash.Hash\n}\n```\nHasher is a struct that will generate a SHA1\n\n```go\nfunc NewHasher(t ObjectType, size int64) Hasher\n```\nNewHasher takes an object type and size and creates a hasher to generate a SHA\n\n```go\nfunc (h Hasher) Sum() (sha1 SHA1)\n```\nSum generates a SHA1 for the provided hash\n\n```go\ntype Hook struct {\n\tIsActive bool   // Indicates whether repository has this hook.\n\tContent  string // Content of hook if it's active.\n\tSample   string // Sample content from Git.\n\t// contains filtered or unexported fields\n}\n```\nHook represents a Git hook.\n\n```go\nfunc GetHook(repoPath, name string) (*Hook, error)\n```\nGetHook returns a Git hook by given name and repository.\n\n```go\nfunc ListHooks(repoPath string) (_ []*Hook, err error)\n```\nListHooks returns a list of Git hooks of given repository.\n\n```go\nfunc (h *Hook) Name() string\n```\nName return the name of the hook\n\n```go\nfunc (h *Hook) Update() error\n```\nUpdate updates hook settings.\n\n```go\ntype ImageMetaData struct {\n\tColorModel color.Model\n\tWidth      int\n\tHeight     int\n\tByteSize   int64\n}\n```\nImageMetaData represents metadata of an image file\n\n```go\ntype LastCommitCache struct {\n\t// contains filtered or unexported fields\n}\n```\nLastCommitCache represents a cache to store last commit\n\n```go\nfunc NewLastCommitCache(repoPath string, gitRepo *Repository, ttl func() int64, cache Cache) *LastCommitCache\n```\nNewLastCommitCache creates a new last commit cache for repo\n\n```go\nfunc (c *LastCommitCache) CacheCommit(commit *Commit) error\n```\nCacheCommit will cache the commit from the gitRepository\n\n```go\nfunc (c *LastCommitCache) Get(ref, entryPath string) (interface{}, error)\n```\nGet get the last commit information by commit id and entry path\n\n```go\nfunc (c *LastCommitCache) Put(ref, entryPath, commitID string) error\n```\nPut put the last commit id with commit and entry path\n\n```go\ntype LimitedReaderCloser struct {\n\tR io.Reader\n\tC io.Closer\n\tN int64\n}\n```\nLimitedReaderCloser is a limited reader closer\n\n```go\nfunc (l *LimitedReaderCloser) Close() error\n```\nClose implements io.Closer\n\n```go\nfunc (l *LimitedReaderCloser) Read(p []byte) (n int, err error)\n```\nRead implements io.Reader\n\n```go\ntype Note struct {\n\tMessage []byte\n\tCommit  *Commit\n}\n```\nNote stores information about a note created using git-notes.\n\n```go\ntype ObjectCache struct {\n\t// contains filtered or unexported fields\n}\n```\nObjectCache provides thread-safe cache opeations.\n\n```go\nfunc (oc *ObjectCache) Get(id string) (interface{}, bool)\n```\nGet get cached obj by id\n\n```go\nfunc (oc *ObjectCache) Set(id string, obj interface{})\n```\nSet add obj to cache\n\n```go\ntype ObjectType string\n```\nObjectType git object type\n\n```go\nconst (\n\t// ObjectCommit commit object type\n\tObjectCommit ObjectType = \"commit\"\n\t// ObjectTree tree object type\n\tObjectTree ObjectType = \"tree\"\n\t// ObjectBlob blob object type\n\tObjectBlob ObjectType = \"blob\"\n\t// ObjectTag tag object type\n\tObjectTag ObjectType = \"tag\"\n\t// ObjectBranch branch object type\n\tObjectBranch ObjectType = \"branch\"\n)\n```\n\n```go\nfunc (o ObjectType) Bytes() []byte\n```\nBytes returns the byte array for the Object Type\n\n```go\ntype PullRemoteOptions struct {\n\tTimeout time.Duration\n\tAll     bool\n\tRebase  bool\n\tRemote  string\n\tBranch  string\n}\n```\nPullRemoteOptions options when pull from remote\n\n```go\ntype PushOptions struct {\n\tRemote string\n\tBranch string\n\tForce  bool\n\tEnv    []string\n}\n```\nPushOptions options when push to remote\n\n```go\ntype RawDiffType string\n```\nRawDiffType type of a raw diff.\n\n```go\nconst (\n\tRawDiffNormal RawDiffType = \"diff\"\n\tRawDiffPatch  RawDiffType = \"patch\"\n)\n```\nRawDiffType possible values.\n\n```go\ntype Reference struct {\n\tName string\n\n\tObject SHA1 // The id of this commit object\n\tType   string\n\t// contains filtered or unexported fields\n}\n```\nReference represents a Git ref.\n\n```go\nfunc (ref *Reference) Commit() (*Commit, error)\n```\nCommit return the commit of the reference\n\n```go\nfunc (ref *Reference) RefGroup() string\n```\nRefGroup returns the group type of the reference\n\n```go\nfunc (ref *Reference) ShortName() string\n```\nShortName returns the short name of the reference\n\n```go\ntype Repository struct {\n\tPath string\n\t// contains filtered or unexported fields\n}\n```\nRepository represents a Git repository.\n\n```go\nfunc OpenRepository(repoPath string) (*Repository, error)\n```\nOpenRepository opens the repository at the given path.\n\n```go\nfunc (repo *Repository) AddObjectToIndex(mode string, object SHA1, filename string) error\n```\nAddObjectToIndex adds the provided object hash to the index at the provided filename\n\n```go\nfunc (repo *Repository) AddRemote(name, url string, fetch bool) error\n```\nAddRemote adds a new remote to repository.\n\n```go\nfunc (repo *Repository) CheckAttribute(opts CheckAttributeOpts) (map[string]map[string]string, error)\n```\nCheckAttribute return the Blame object of file\n\n```go\nfunc (repo *Repository) Close()\n```\nClose this repository, in particular close the underlying gogitStorage if this is not nil\n\n```go\nfunc (repo *Repository) CommitTree(author *Signature, committer *Signature, tree *Tree, opts CommitTreeOpts) (SHA1, error)\n```\nCommitTree creates a commit from a given tree id for the user with provided message\n\n```go\nfunc (repo *Repository) CommitsBetween(last *Commit, before *Commit) (*list.List, error)\n```\nCommitsBetween returns a list that contains commits between \\[last, before).\n\n```go\nfunc (repo *Repository) CommitsBetweenIDs(last, before string) (*list.List, error)\n```\nCommitsBetweenIDs return commits between twoe commits\n\n```go\nfunc (repo *Repository) CommitsBetweenLimit(last *Commit, before *Commit, limit, skip int) (*list.List, error)\n```\nCommitsBetweenLimit returns a list that contains at most limit commits skipping the first skip commits between \\[last, before)\n\n```go\nfunc (repo *Repository) CommitsByFileAndRange(revision, file string, page int) (*list.List, error)\n```\nCommitsByFileAndRange return the commits according revison file and the page\n\n```go\nfunc (repo *Repository) CommitsByFileAndRangeNoFollow(revision, file string, page int) (*list.List, error)\n```\nCommitsByFileAndRangeNoFollow return the commits according revison file and the page\n\n```go\nfunc (repo *Repository) CommitsCountBetween(start, end string) (int64, error)\n```\nCommitsCountBetween return numbers of commits between two commits\n\n```go\nfunc (repo *Repository) ConvertToSHA1(commitID string) (SHA1, error)\n```\nConvertToSHA1 returns a Hash object from a potential ID string\n\n```go\nfunc (repo *Repository) CreateAnnotatedTag(name, message, revision string) error\n```\nCreateAnnotatedTag create one annotated tag in the repository\n\n```go\nfunc (repo *Repository) CreateBranch(branch, oldbranchOrCommit string) error\n```\nCreateBranch create a new branch\n\n```go\nfunc (repo *Repository) CreateTag(name, revision string) error\n```\nCreateTag create one tag in the repository\n\n```go\nfunc (repo *Repository) DeleteBranch(name string, opts DeleteBranchOptions) error\n```\nDeleteBranch delete a branch by name on repository.\n\n```go\nfunc (repo *Repository) EmptyIndex() error\n```\nEmptyIndex empties the index\n\n```go\nfunc (repo *Repository) FileBlame(revision, path, file string) ([]byte, error)\n```\nFileBlame return the Blame object of file\n\n```go\nfunc (repo *Repository) FileChangedBetweenCommits(filename, id1, id2 string) (bool, error)\n```\nFileChangedBetweenCommits Returns true if the file changed between commit IDs id1 and id2 You must ensure that id1 and id2 are valid commit ids.\n\n```go\nfunc (repo *Repository) FileCommitsCount(revision, file string) (int64, error)\n```\nFileCommitsCount return the number of files at a revison\n\n```go\nfunc (repo *Repository) FilesCountBetween(startCommitID, endCommitID string) (int, error)\n```\nFilesCountBetween return the number of files changed between two commits\n\n```go\nfunc (repo *Repository) GetAllCommitsCount() (int64, error)\n```\nGetAllCommitsCount returns count of all commits in repository\n\n```go\nfunc (repo *Repository) GetAnnotatedTag(sha string) (*Tag, error)\n```\nGetAnnotatedTag returns a Git tag by its SHA, must be an annotated tag\n\n```go\nfunc (repo *Repository) GetBlob(idStr string) (*Blob, error)\n```\nGetBlob finds the blob object in the repository.\n\n```go\nfunc (repo *Repository) GetBranch(branch string) (*Branch, error)\n```\nGetBranch returns a branch by it's name\n\n```go\nfunc (repo *Repository) GetBranchCommit(name string) (*Commit, error)\n```\nGetBranchCommit returns the last commit of given branch.\n\n```go\nfunc (repo *Repository) GetBranchCommitID(name string) (string, error)\n```\nGetBranchCommitID returns last commit ID string of given branch.\n\n```go\nfunc (repo *Repository) GetBranches(skip, limit int) ([]string, int, error)\n```\nGetBranches returns branches from the repository, skipping skip initial branches and returning at most limit branches, or all branches if limit is 0.\n\n```go\nfunc (repo *Repository) GetCodeActivityStats(fromTime time.Time, branch string) (*CodeActivityStats, error)\n```\nGetCodeActivityStats returns code statistics for acitivity page\n\n```go\nfunc (repo *Repository) GetCommit(commitID string) (*Commit, error)\n```\nGetCommit returns commit object of by ID string.\n\n```go\nfunc (repo *Repository) GetCommitByPath(relpath string) (*Commit, error)\n```\nGetCommitByPath returns the last commit of relative path.\n\n```go\nfunc (repo *Repository) GetCommitsFromIDs(commitIDs []string) (commits *list.List)\n```\nGetCommitsFromIDs get commits from commit IDs\n\n```go\nfunc (repo *Repository) GetCompareInfo(basePath, baseBranch, headBranch string) (_ *CompareInfo, err error)\n```\nGetCompareInfo generates and returns compare information between base and head branches of repositories.\n\n```go\nfunc (repo *Repository) GetDefaultBranch() (string, error)\n```\nGetDefaultBranch gets default branch of repository.\n\n```go\nfunc (repo *Repository) GetDefaultPublicGPGKey(forceUpdate bool) (*GPGSettings, error)\n```\nGetDefaultPublicGPGKey will return and cache the default public GPG settings for this repository\n\n```go\nfunc (repo *Repository) GetDiff(base, head string, w io.Writer) error\n```\nGetDiff generates and returns patch data between given revisions.\n\n```go\nfunc (repo *Repository) GetDiffFromMergeBase(base, head string, w io.Writer) error\n```\nGetDiffFromMergeBase generates and return patch data from merge base to head\n\n```go\nfunc (repo *Repository) GetDiffNumChangedFiles(base, head string) (int, error)\n```\nGetDiffNumChangedFiles counts the number of changed files This is substantially quicker than shortstat but...\n\n```go\nfunc (repo *Repository) GetDiffOrPatch(base, head string, w io.Writer, formatted bool) error\n```\nGetDiffOrPatch generates either diff or formatted patch data between given revisions\n\n```go\nfunc (repo *Repository) GetDiffShortStat(base, head string) (numFiles, totalAdditions, totalDeletions int, err error)\n```\nGetDiffShortStat counts number of changed files, number of additions and deletions\n\n```go\nfunc (repo *Repository) GetHEADBranch() (*Branch, error)\n```\nGetHEADBranch returns corresponding branch of HEAD.\n\n```go\nfunc (repo *Repository) GetHook(name string) (*Hook, error)\n```\nGetHook get one hook according the name on a repository\n\n```go\nfunc (repo *Repository) GetLanguageStats(commitID string) (map[string]int64, error)\n```\nGetLanguageStats calculates language stats for git repository at specified commit\n\n```go\nfunc (repo *Repository) GetMergeBase(tmpRemote string, base, head string) (string, string, error)\n```\nGetMergeBase checks and returns merge base of two branches and the reference used as base.\n\n```go\nfunc (repo *Repository) GetPatch(base, head string, w io.Writer) error\n```\nGetPatch generates and returns format-patch data between given revisions.\n\n```go\nfunc (repo *Repository) GetRefCommitID(name string) (string, error)\n```\nGetRefCommitID returns the last commit ID string of given reference (branch or tag).\n\n```go\nfunc (repo *Repository) GetRefType(ref string) ObjectType\n```\nGetRefType gets the type of the ref based on the string\n\n```go\nfunc (repo *Repository) GetRefs() ([]*Reference, error)\n```\nGetRefs returns all references of the repository.\n\n```go\nfunc (repo *Repository) GetRefsFiltered(pattern string) ([]*Reference, error)\n```\nGetRefsFiltered returns all references of the repository that matches patterm exactly or starting with.\n\n```go\nfunc (repo *Repository) GetTag(name string) (*Tag, error)\n```\nGetTag returns a Git tag by given name.\n\n```go\nfunc (repo *Repository) GetTagCommit(name string) (*Commit, error)\n```\nGetTagCommit get the commit of the specific tag via name\n\n```go\nfunc (repo *Repository) GetTagCommitID(name string) (string, error)\n```\nGetTagCommitID returns last commit ID string of given tag.\n\n```go\nfunc (repo *Repository) GetTagID(name string) (string, error)\n```\nGetTagID returns the object ID for a tag (annotated tags have both an object SHA AND a commit SHA)\n\n```go\nfunc (repo *Repository) GetTagInfos(page, pageSize int) ([]*Tag, error)\n```\nGetTagInfos returns all tag infos of the repository.\n\n```go\nfunc (repo *Repository) GetTagNameBySHA(sha string) (string, error)\n```\nGetTagNameBySHA returns the name of a tag from its tag object SHA or commit SHA\n\n```go\nfunc (repo *Repository) GetTagType(id SHA1) (string, error)\n```\nGetTagType gets the type of the tag, either commit (simple) or tag (annotated)\n\n```go\nfunc (repo *Repository) GetTags() (tags []string, err error)\n```\nGetTags returns all tags of the repository.\n\n```go\nfunc (repo *Repository) GetTree(idStr string) (*Tree, error)\n```\nGetTree find the tree object in the repository.\n\n```go\nfunc (repo *Repository) HashObject(reader io.Reader) (SHA1, error)\n```\nHashObject takes a reader and returns SHA1 hash for that reader\n\n```go\nfunc (repo *Repository) Hooks() ([]*Hook, error)\n```\nHooks get all the hooks on the repository\n\n```go\nfunc (repo *Repository) IsBranchExist(name string) bool\n```\nIsBranchExist returns true if given branch exists in current repository.\n\n```go\nfunc (repo *Repository) IsCommitExist(name string) bool\n```\nIsCommitExist returns true if given commit exists in current repository.\n\n```go\nfunc (repo *Repository) IsCommitInBranch(commitID, branch string) (r bool, err error)\n```\nIsCommitInBranch check if the commit is on the branch\n\n```go\nfunc (repo *Repository) IsEmpty() (bool, error)\n```\nIsEmpty Check if repository is empty.\n\n```go\nfunc (repo *Repository) IsTagExist(name string) bool\n```\nIsTagExist returns true if given tag exists in the repository.\n\n```go\nfunc (repo *Repository) LineBlame(revision, path, file string, line uint) (*Commit, error)\n```\nLineBlame returns the latest commit at the given line\n\n```go\nfunc (repo *Repository) LsFiles(filenames ...string) ([]string, error)\n```\nLsFiles checks if the given filenames are in the index\n\n```go\nfunc (repo *Repository) ReadTreeToIndex(treeish string) error\n```\nReadTreeToIndex reads a treeish to the index\n\n```go\nfunc (repo *Repository) RemoveFilesFromIndex(filenames ...string) error\n```\nRemoveFilesFromIndex removes given filenames from the index - it does not check whether they are present.\n\n```go\nfunc (repo *Repository) RemoveRemote(name string) error\n```\nRemoveRemote removes a remote from repository.\n\n```go\nfunc (repo *Repository) ResolveReference(name string) (string, error)\n```\nResolveReference resolves a name to a reference\n\n```go\nfunc (repo *Repository) SetDefaultBranch(name string) error\n```\nSetDefaultBranch sets default branch of repository.\n\n```go\nfunc (repo *Repository) WriteTree() (*Tree, error)\n```\nWriteTree writes the current index as a tree to the object db and returns its hash\n\n```go\ntype SHA1 [20]byte\n```\nSHA1 a git commit name\n\n```go\nfunc ComputeBlobHash(content []byte) SHA1\n```\nComputeBlobHash compute the hash for a given blob content\n\n```go\nfunc ComputeHash(t ObjectType, content []byte) SHA1\n```\nComputeHash compute the hash for a given ObjectType and content\n\n```go\nfunc MustID(b []byte) SHA1\n```\nMustID always creates a new SHA1 from a \\[20]byte array with no validation of input.\n\n```go\nfunc MustIDFromString(s string) SHA1\n```\nMustIDFromString always creates a new sha from a ID with no validation of input.\n\n```go\nfunc NewID(b []byte) (SHA1, error)\n```\nNewID creates a new SHA1 from a \\[20]byte array.\n\n```go\nfunc NewIDFromString(s string) (SHA1, error)\n```\nNewIDFromString creates a new SHA1 from a ID string of length 40.\n\n```go\nfunc (s SHA1) IsZero() bool\n```\nIsZero returns whether this SHA1 is all zeroes\n\n```go\nfunc (s SHA1) String() string\n```\nString returns a string representation of the SHA\n\n```go\ntype SearchCommitsOptions struct {\n\tKeywords            []string\n\tAuthors, Committers []string\n\tAfter, Before       string\n\tAll                 bool\n}\n```\nSearchCommitsOptions specify the parameters for SearchCommits\n\n```go\nfunc NewSearchCommitsOptions(searchString string, forAllRefs bool) SearchCommitsOptions\n```\nNewSearchCommitsOptions construct a SearchCommitsOption from a space-delimited search string\n\n```go\ntype Signature struct {\n\t// Name represents a person name. It is an arbitrary string.\n\tName string\n\t// Email is an email, but it cannot be assumed to be well-formed.\n\tEmail string\n\t// When is the timestamp of the signature.\n\tWhen time.Time\n}\n```\nSignature represents the Author or Committer information.\n\n```go\nfunc (s *Signature) Decode(b []byte)\n```\nDecode decodes a byte array representing a signature to signature\n\n```go\nfunc (s *Signature) String() string\n```\n\n```go\ntype SubModule struct {\n\tName string\n\tURL  string\n}\n```\nSubModule submodule is a reference on git repository\n\n```go\ntype SubModuleFile struct {\n\t*Commit\n\t// contains filtered or unexported fields\n}\n```\nSubModuleFile represents a file with submodule type.\n\n```go\nfunc NewSubModuleFile(c *Commit, refURL, refID string) *SubModuleFile\n```\nNewSubModuleFile create a new submodule file\n\n```go\nfunc (sf *SubModuleFile) RefID() string\n```\nRefID returns reference ID.\n\n```go\nfunc (sf *SubModuleFile) RefURL(urlPrefix, repoFullName, sshDomain string) string\n```\nRefURL guesses and returns reference URL.\n\n```go\ntype Tag struct {\n\tName string\n\tID   SHA1\n\n\tObject    SHA1 // The id of this commit object\n\tType      string\n\tTagger    *Signature\n\tMessage   string\n\tSignature *CommitGPGSignature\n\t// contains filtered or unexported fields\n}\n```\nTag represents a Git tag.\n\n```go\nfunc (tag *Tag) Commit() (*Commit, error)\n```\nCommit return the commit of the tag reference\n\n```go\ntype Tree struct {\n\tID         SHA1\n\tResolvedID SHA1\n\t// contains filtered or unexported fields\n}\n```\nTree represents a flat directory listing.\n\n```go\nfunc NewTree(repo *Repository, id SHA1) *Tree\n```\nNewTree create a new tree according the repository and tree id\n\n```go\nfunc (t *Tree) GetBlobByPath(relpath string) (*Blob, error)\n```\nGetBlobByPath get the blob object according the path\n\n```go\nfunc (t *Tree) GetTreeEntryByPath(relpath string) (*TreeEntry, error)\n```\nGetTreeEntryByPath get the tree entries according the sub dir\n\n```go\nfunc (t *Tree) ListEntries() (Entries, error)\n```\nListEntries returns all entries of current tree.\n\n```go\nfunc (t *Tree) ListEntriesRecursive() (Entries, error)\n```\nListEntriesRecursive returns all entries of current tree recursively including all subtrees\n\n```go\nfunc (t *Tree) SubTree(rpath string) (*Tree, error)\n```\nSubTree get a sub tree by the sub dir path\n\n```go\ntype TreeEntry struct {\n\tID SHA1\n\t// contains filtered or unexported fields\n}\n```\nTreeEntry the leaf in the git tree\n\n```go\nfunc ParseTreeEntries(data []byte) ([]*TreeEntry, error)\n```\nParseTreeEntries parses the output of a \\`git ls-tree -l\\` command.\n\n```go\nfunc (te *TreeEntry) Blob() *Blob\n```\nBlob returns the blob object the entry\n\n```go\nfunc (te *TreeEntry) FollowLink() (*TreeEntry, error)\n```\nFollowLink returns the entry pointed to by a symlink\n\n```go\nfunc (te *TreeEntry) FollowLinks() (*TreeEntry, error)\n```\nFollowLinks returns the entry ultimately pointed to by a symlink\n\n```go\nfunc (te *TreeEntry) GetSubJumpablePathName() string\n```\nGetSubJumpablePathName return the full path of subdirectory jumpable ( contains only one directory )\n\n```go\nfunc (te *TreeEntry) IsDir() bool\n```\nIsDir if the entry is a sub dir\n\n```go\nfunc (te *TreeEntry) IsExecutable() bool\n```\nIsExecutable if the entry is an executable file (not necessarily binary)\n\n```go\nfunc (te *TreeEntry) IsLink() bool\n```\nIsLink if the entry is a symlink\n\n```go\nfunc (te *TreeEntry) IsRegular() bool\n```\nIsRegular if the entry is a regular file\n\n```go\nfunc (te *TreeEntry) IsSubModule() bool\n```\nIsSubModule if the entry is a sub module\n\n```go\nfunc (te *TreeEntry) Mode() EntryMode\n```\nMode returns the mode of the entry\n\n```go\nfunc (te *TreeEntry) Name() string\n```\nName returns the name of the entry\n\n```go\nfunc (te *TreeEntry) Size() int64\n```\nSize returns the size of the entry\n\n```go\nfunc (te *TreeEntry) Type() string\n```\nType returns the type of the entry (commit, tree, blob)\n\n","path":"github.com/RedAFD/code-core/modules/git","name":"git","synopsis":"","isRedistributable":true}
