{"modulePath":"github.com/libgit2/git2go/v28","version":"v28.9.9","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git\n\n## Constants\n\n```go\nconst (\n\tCheckoutNotifyNone      CheckoutNotifyType = C.GIT_CHECKOUT_NOTIFY_NONE\n\tCheckoutNotifyConflict  CheckoutNotifyType = C.GIT_CHECKOUT_NOTIFY_CONFLICT\n\tCheckoutNotifyDirty     CheckoutNotifyType = C.GIT_CHECKOUT_NOTIFY_DIRTY\n\tCheckoutNotifyUpdated   CheckoutNotifyType = C.GIT_CHECKOUT_NOTIFY_UPDATED\n\tCheckoutNotifyUntracked CheckoutNotifyType = C.GIT_CHECKOUT_NOTIFY_UNTRACKED\n\tCheckoutNotifyIgnored   CheckoutNotifyType = C.GIT_CHECKOUT_NOTIFY_IGNORED\n\tCheckoutNotifyAll       CheckoutNotifyType = C.GIT_CHECKOUT_NOTIFY_ALL\n\n\tCheckoutNone                      CheckoutStrategy = C.GIT_CHECKOUT_NONE                         // Dry run, no actual updates\n\tCheckoutSafe                      CheckoutStrategy = C.GIT_CHECKOUT_SAFE                         // Allow safe updates that cannot overwrite uncommitted data\n\tCheckoutForce                     CheckoutStrategy = C.GIT_CHECKOUT_FORCE                        // Allow all updates to force working directory to look like index\n\tCheckoutRecreateMissing           CheckoutStrategy = C.GIT_CHECKOUT_RECREATE_MISSING             // Allow checkout to recreate missing files\n\tCheckoutAllowConflicts            CheckoutStrategy = C.GIT_CHECKOUT_ALLOW_CONFLICTS              // Allow checkout to make safe updates even if conflicts are found\n\tCheckoutRemoveUntracked           CheckoutStrategy = C.GIT_CHECKOUT_REMOVE_UNTRACKED             // Remove untracked files not in index (that are not ignored)\n\tCheckoutRemoveIgnored             CheckoutStrategy = C.GIT_CHECKOUT_REMOVE_IGNORED               // Remove ignored files not in index\n\tCheckoutUpdateOnly                CheckoutStrategy = C.GIT_CHECKOUT_UPDATE_ONLY                  // Only update existing files, don't create new ones\n\tCheckoutDontUpdateIndex           CheckoutStrategy = C.GIT_CHECKOUT_DONT_UPDATE_INDEX            // Normally checkout updates index entries as it goes; this stops that\n\tCheckoutNoRefresh                 CheckoutStrategy = C.GIT_CHECKOUT_NO_REFRESH                   // Don't refresh index/config/etc before doing checkout\n\tCheckoutSkipUnmerged              CheckoutStrategy = C.GIT_CHECKOUT_SKIP_UNMERGED                // Allow checkout to skip unmerged files\n\tCheckoutUseOurs                   CheckoutStrategy = C.GIT_CHECKOUT_USE_OURS                     // For unmerged files, checkout stage 2 from index\n\tCheckoutUseTheirs                 CheckoutStrategy = C.GIT_CHECKOUT_USE_THEIRS                   // For unmerged files, checkout stage 3 from index\n\tCheckoutDisablePathspecMatch      CheckoutStrategy = C.GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH       // Treat pathspec as simple list of exact match file paths\n\tCheckoutSkipLockedDirectories     CheckoutStrategy = C.GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES      // Ignore directories in use, they will be left empty\n\tCheckoutDontOverwriteIgnored      CheckoutStrategy = C.GIT_CHECKOUT_DONT_OVERWRITE_IGNORED       // Don't overwrite ignored files that exist in the checkout target\n\tCheckoutConflictStyleMerge        CheckoutStrategy = C.GIT_CHECKOUT_CONFLICT_STYLE_MERGE         // Write normal merge files for conflicts\n\tCheckoutConflictStyleDiff3        CheckoutStrategy = C.GIT_CHECKOUT_CONFLICT_STYLE_DIFF3         // Include common ancestor data in diff3 format files for conflicts\n\tCheckoutDontRemoveExisting        CheckoutStrategy = C.GIT_CHECKOUT_DONT_REMOVE_EXISTING         // Don't overwrite existing files or folders\n\tCheckoutDontWriteIndex            CheckoutStrategy = C.GIT_CHECKOUT_DONT_WRITE_INDEX             // Normally checkout writes the index upon completion; this prevents that\n\tCheckoutUpdateSubmodules          CheckoutStrategy = C.GIT_CHECKOUT_UPDATE_SUBMODULES            // Recursively checkout submodules with same options (NOT IMPLEMENTED)\n\tCheckoutUpdateSubmodulesIfChanged CheckoutStrategy = C.GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED // Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED)\n)\n```\n\n```go\nconst (\n\t// Deprecated: FeatureHttps is a deprecated alias of FeatureHTTPS.\n\tFeatureHttps = FeatureHTTPS\n\n\t// Deprecated: FeatureSsh is a deprecated alias of FeatureSSH.\n\tFeatureSsh = FeatureSSH\n)\n```\n\n```go\nconst (\n\t// Deprecated: ErrClassNone is a deprecated alias of ErrorClassNone.\n\tErrClassNone = ErrorClassNone\n\t// Deprecated: ErrClassNoMemory is a deprecated alias of ErrorClassNoMemory.\n\tErrClassNoMemory = ErrorClassNoMemory\n\t// Deprecated: ErrClassOs is a deprecated alias of ErrorClassOS.\n\tErrClassOs = ErrorClassOS\n\t// Deprecated: ErrClassInvalid is a deprecated alias of ErrorClassInvalid.\n\tErrClassInvalid = ErrorClassInvalid\n\t// Deprecated: ErrClassReference is a deprecated alias of ErrorClassReference.\n\tErrClassReference = ErrorClassReference\n\t// Deprecated: ErrClassZlib is a deprecated alias of ErrorClassZlib.\n\tErrClassZlib = ErrorClassZlib\n\t// Deprecated: ErrClassRepository is a deprecated alias of ErrorClassRepository.\n\tErrClassRepository = ErrorClassRepository\n\t// Deprecated: ErrClassConfig is a deprecated alias of ErrorClassConfig.\n\tErrClassConfig = ErrorClassConfig\n\t// Deprecated: ErrClassRegex is a deprecated alias of ErrorClassRegex.\n\tErrClassRegex = ErrorClassRegex\n\t// Deprecated: ErrClassOdb is a deprecated alias of ErrorClassOdb.\n\tErrClassOdb = ErrorClassOdb\n\t// Deprecated: ErrClassIndex is a deprecated alias of ErrorClassIndex.\n\tErrClassIndex = ErrorClassIndex\n\t// Deprecated: ErrClassObject is a deprecated alias of ErrorClassObject.\n\tErrClassObject = ErrorClassObject\n\t// Deprecated: ErrClassNet is a deprecated alias of ErrorClassNet.\n\tErrClassNet = ErrorClassNet\n\t// Deprecated: ErrClassTag is a deprecated alias of ErrorClassTag.\n\tErrClassTag = ErrorClassTag\n\t// Deprecated: ErrClassTree is a deprecated alias of ErrorClassTree.\n\tErrClassTree = ErrorClassTree\n\t// Deprecated: ErrClassIndexer is a deprecated alias of ErrorClassIndexer.\n\tErrClassIndexer = ErrorClassIndexer\n\t// Deprecated: ErrClassSSL is a deprecated alias of ErrorClassSSL.\n\tErrClassSSL = ErrorClassSSL\n\t// Deprecated: ErrClassSubmodule is a deprecated alias of ErrorClassSubmodule.\n\tErrClassSubmodule = ErrorClassSubmodule\n\t// Deprecated: ErrClassThread is a deprecated alias of ErrorClassThread.\n\tErrClassThread = ErrorClassThread\n\t// Deprecated: ErrClassStash is a deprecated alias of ErrorClassStash.\n\tErrClassStash = ErrorClassStash\n\t// Deprecated: ErrClassCheckout is a deprecated alias of ErrorClassCheckout.\n\tErrClassCheckout = ErrorClassCheckout\n\t// Deprecated: ErrClassFetchHead is a deprecated alias of ErrorClassFetchHead.\n\tErrClassFetchHead = ErrorClassFetchHead\n\t// Deprecated: ErrClassMerge is a deprecated alias of ErrorClassMerge.\n\tErrClassMerge = ErrorClassMerge\n\t// Deprecated: ErrClassSsh is a deprecated alias of ErrorClassSSH.\n\tErrClassSsh = ErrorClassSSH\n\t// Deprecated: ErrClassFilter is a deprecated alias of ErrorClassFilter.\n\tErrClassFilter = ErrorClassFilter\n\t// Deprecated: ErrClassRevert is a deprecated alias of ErrorClassRevert.\n\tErrClassRevert = ErrorClassRevert\n\t// Deprecated: ErrClassCallback is a deprecated alias of ErrorClassCallback.\n\tErrClassCallback = ErrorClassCallback\n\t// Deprecated: ErrClassRebase is a deprecated alias of ErrorClassRebase.\n\tErrClassRebase = ErrorClassRebase\n\t// Deprecated: ErrClassPatch is a deprecated alias of ErrorClassPatch.\n\tErrClassPatch = ErrorClassPatch\n)\n```\n\n```go\nconst (\n\t// Deprecated: ErrOk is a deprecated alias of ErrorCodeOK.\n\tErrOk = ErrorCodeOK\n\t// Deprecated: ErrGeneric is a deprecated alias of ErrorCodeGeneric.\n\tErrGeneric = ErrorCodeGeneric\n\t// Deprecated: ErrNotFound is a deprecated alias of ErrorCodeNotFound.\n\tErrNotFound = ErrorCodeNotFound\n\t// Deprecated: ErrExists is a deprecated alias of ErrorCodeExists.\n\tErrExists = ErrorCodeExists\n\t// Deprecated: ErrAmbiguous is a deprecated alias of ErrorCodeAmbiguous.\n\tErrAmbiguous = ErrorCodeAmbiguous\n\t// Deprecated: ErrAmbigious is a deprecated alias of ErrorCodeAmbiguous.\n\tErrAmbigious = ErrorCodeAmbiguous\n\t// Deprecated: ErrBuffs is a deprecated alias of ErrorCodeBuffs.\n\tErrBuffs = ErrorCodeBuffs\n\t// Deprecated: ErrUser is a deprecated alias of ErrorCodeUser.\n\tErrUser = ErrorCodeUser\n\t// Deprecated: ErrBareRepo is a deprecated alias of ErrorCodeBareRepo.\n\tErrBareRepo = ErrorCodeBareRepo\n\t// Deprecated: ErrUnbornBranch is a deprecated alias of ErrorCodeUnbornBranch.\n\tErrUnbornBranch = ErrorCodeUnbornBranch\n\t// Deprecated: ErrUnmerged is a deprecated alias of ErrorCodeUnmerged.\n\tErrUnmerged = ErrorCodeUnmerged\n\t// Deprecated: ErrNonFastForward is a deprecated alias of ErrorCodeNonFastForward.\n\tErrNonFastForward = ErrorCodeNonFastForward\n\t// Deprecated: ErrInvalidSpec is a deprecated alias of ErrorCodeInvalidSpec.\n\tErrInvalidSpec = ErrorCodeInvalidSpec\n\t// Deprecated: ErrConflict is a deprecated alias of ErrorCodeConflict.\n\tErrConflict = ErrorCodeConflict\n\t// Deprecated: ErrLocked is a deprecated alias of ErrorCodeLocked.\n\tErrLocked = ErrorCodeLocked\n\t// Deprecated: ErrModified is a deprecated alias of ErrorCodeModified.\n\tErrModified = ErrorCodeModified\n\t// Deprecated: ErrAuth is a deprecated alias of ErrorCodeAuth.\n\tErrAuth = ErrorCodeAuth\n\t// Deprecated: ErrCertificate is a deprecated alias of ErrorCodeCertificate.\n\tErrCertificate = ErrorCodeCertificate\n\t// Deprecated: ErrApplied is a deprecated alias of ErrorCodeApplied.\n\tErrApplied = ErrorCodeApplied\n\t// Deprecated: ErrPeel is a deprecated alias of ErrorCodePeel.\n\tErrPeel = ErrorCodePeel\n\t// Deprecated: ErrEOF is a deprecated alias of ErrorCodeEOF.\n\tErrEOF = ErrorCodeEOF\n\t// Deprecated: ErrUncommitted is a deprecated alias of ErrorCodeUncommitted.\n\tErrUncommitted = ErrorCodeUncommitted\n\t// Deprecated: ErrDirectory is a deprecated alias of ErrorCodeDirectory.\n\tErrDirectory = ErrorCodeDirectory\n\t// Deprecated: ErrMergeConflict is a deprecated alias of ErrorCodeMergeConflict.\n\tErrMergeConflict = ErrorCodeMergeConflict\n\t// Deprecated: ErrPassthrough is a deprecated alias of ErrorCodePassthrough.\n\tErrPassthrough = ErrorCodePassthrough\n\t// Deprecated: ErrIterOver is a deprecated alias of ErrorCodeIterOver.\n\tErrIterOver = ErrorCodeIterOver\n\t// Deprecated: ErrApplyFail is a deprecated alias of ErrorCodeApplyFail.\n\tErrApplyFail = ErrorCodeApplyFail\n)\n```\n\n```go\nconst (\n\tRemoteCompletionDownload RemoteCompletion = C.GIT_REMOTE_COMPLETION_DOWNLOAD\n\tRemoteCompletionIndexing RemoteCompletion = C.GIT_REMOTE_COMPLETION_INDEXING\n\tRemoteCompletionError    RemoteCompletion = C.GIT_REMOTE_COMPLETION_ERROR\n\n\tConnectDirectionFetch ConnectDirection = C.GIT_DIRECTION_FETCH\n\tConnectDirectionPush  ConnectDirection = C.GIT_DIRECTION_PUSH\n)\n```\n\n```go\nconst (\n\t// Deprecated: DiffIgnoreWhitespaceEol is a deprecated alias of DiffIgnoreWhitespaceEOL.\n\tDiffIgnoreWitespaceEol = DiffIgnoreWhitespaceEOL\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrDeltaSkip = errors.New(\"Skip delta\")\n)\n```\n\n```go\nvar (\n\tErrInvalid = errors.New(\"Invalid state for operation\")\n)\n```\n\n```go\nvar ErrRebaseNoOperation = errors.New(\"no current rebase operation\")\n```\nError returned if there is no current rebase operation\n\n```go\nvar RebaseNoOperation uint = ^uint(0)\n```\nSpecial value indicating that there is no currently active operation\n\n## Functions\n\n```go\nfunc CachedMemory() (current int, allowed int, err error)\n```\n\n```go\nfunc CallbackGitTreeWalk(_root *C.char, entry *C.git_tree_entry, ptr unsafe.Pointer) C.int\n```\nDeprecated: CallbackGitTreeWalk is not used.\n\n```go\nfunc ConfigFindGlobal() (string, error)\n```\n\n```go\nfunc ConfigFindProgramdata() (string, error)\n```\nConfigFindProgramdata locate the path to the configuration file in ProgramData.\n\nLook for the file in %PROGRAMDATA%\\\\Git\\\\config used by portable git.\n\n```go\nfunc ConfigFindSystem() (string, error)\n```\n\n```go\nfunc ConfigFindXDG() (string, error)\n```\n\n```go\nfunc DiffBlobs(oldBlob *Blob, oldAsPath string, newBlob *Blob, newAsPath string, opts *DiffOptions, fileCallback DiffForEachFileCallback, detail DiffDetail) error\n```\nDiffBlobs performs a diff between two arbitrary blobs. You can pass whatever file names you'd like for them to appear as in the diff.\n\n```go\nfunc Discover(start string, across_fs bool, ceiling_dirs []string) (string, error)\n```\n\n```go\nfunc EnableCaching(enabled bool) error\n```\n\n```go\nfunc EnableFsyncGitDir(enabled bool) error\n```\n\n```go\nfunc EnableStrictHashVerification(enabled bool) error\n```\n\n```go\nfunc GetCachedMemory() (current int, allowed int, err error)\n```\ndeprecated: You should use \\`CachedMemory()\\` instead.\n\n```go\nfunc IsErrorClass(err error, c ErrorClass) bool\n```\n\n```go\nfunc IsErrorCode(err error, c ErrorCode) bool\n```\n\n```go\nfunc MakeGitError(c C.int) error\n```\n\n```go\nfunc MakeGitError2(err int) error\n```\n\n```go\nfunc MwindowMappedLimit() (int, error)\n```\n\n```go\nfunc MwindowSize() (int, error)\n```\n\n```go\nfunc ReInit()\n```\nReInit reinitializes the global state, this is useful if the effective user id has changed and you want to update the stored search paths for gitconfig files. This function frees any references to objects, so it should be called before any other functions are called.\n\n```go\nfunc ReferenceIsValidName(name string) bool\n```\nReferenceIsValidName returns whether the reference name is well-formed.\n\nValid reference names must follow one of two patterns:\n\n1\\. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. \"HEAD\", \"ORIG\\_HEAD\").\n\n2\\. Names prefixed with \"refs/\" can be almost anything. You must avoid the characters '~', '^', ':', ' \\\\ ', '?', '\\[', and '\\*', and the sequences \"..\" and \" @ {\" which have special meaning to revparse.\n\n```go\nfunc ReferenceNormalizeName(name string, flags ReferenceFormat) (string, error)\n```\nReferenceNormalizeName normalizes the reference name and checks validity.\n\nThis will normalize the reference name by removing any leading slash '/' characters and collapsing runs of adjacent slashes between name components into a single slash.\n\nSee git\\_reference\\_symbolic\\_create() for rules about valid names.\n\n```go\nfunc RemoteIsValidName(name string) bool\n```\nRemoteIsValidName returns whether the remote name is well-formed.\n\n```go\nfunc SearchPath(level ConfigLevel) (string, error)\n```\n\n```go\nfunc SetCacheMaxSize(maxSize int) error\n```\n\n```go\nfunc SetCacheObjectLimit(objectType ObjectType, size int) error\n```\n\n```go\nfunc SetMwindowMappedLimit(size int) error\n```\n\n```go\nfunc SetMwindowSize(size int) error\n```\n\n```go\nfunc SetSearchPath(level ConfigLevel, path string) error\n```\n\n```go\nfunc ShortenOids(ids []*Oid, minlen int) (int, error)\n```\n\n```go\nfunc Shutdown()\n```\nShutdown frees all the resources acquired by libgit2. Make sure no references to any git2go objects are live before calling this. After this is called, invoking any function from this library will result in undefined behavior, so make sure this is called carefully.\n\n```go\nfunc SubmoduleStatusIsUnmodified(status int) bool\n```\n\n```go\nfunc SubmoduleVisitor(csub unsafe.Pointer, name *C.char, handle unsafe.Pointer) C.int\n```\nDeprecated: SubmoduleVisitor is not used.\n\n## Types\n\n```go\ntype AnnotatedCommit struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (mh *AnnotatedCommit) Free()\n```\n\n```go\nfunc (mh *AnnotatedCommit) Id() *Oid\n```\n\n```go\ntype ApplyDeltaCallback func(*DiffDelta) (apply bool, err error)\n```\nApplyDeltaCallback is a callback that will be made per hunk when applying a patch.\n\n```go\ntype ApplyHunkCallback func(*DiffHunk) (apply bool, err error)\n```\nApplyHunkCallback is a callback that will be made per delta (file) when applying a patch.\n\n```go\ntype ApplyLocation int\n```\nApplyLocation represents the possible application locations for applying diffs.\n\n```go\nconst (\n\t// ApplyLocationWorkdir applies the patch to the workdir, leaving the\n\t// index untouched. This is the equivalent of `git apply` with no location\n\t// argument.\n\tApplyLocationWorkdir ApplyLocation = C.GIT_APPLY_LOCATION_WORKDIR\n\t// ApplyLocationIndex applies the patch to the index, leaving the working\n\t// directory untouched. This is the equivalent of `git apply --cached`.\n\tApplyLocationIndex ApplyLocation = C.GIT_APPLY_LOCATION_INDEX\n\t// ApplyLocationBoth applies the patch to both the working directory and\n\t// the index. This is the equivalent of `git apply --index`.\n\tApplyLocationBoth ApplyLocation = C.GIT_APPLY_LOCATION_BOTH\n)\n```\n\n```go\ntype ApplyOptions struct {\n\tApplyHunkCallback  ApplyHunkCallback\n\tApplyDeltaCallback ApplyDeltaCallback\n}\n```\nApplyOptions has 2 callbacks that are called for hunks or deltas If these functions return an error, abort the apply process immediately. If the first return value is true, the delta/hunk will be applied. If it is false, the  delta/hunk will not be applied. In either case, the rest of the apply process will continue.\n\n```go\nfunc DefaultApplyOptions() (*ApplyOptions, error)\n```\nDefaultApplyOptions returns default options for applying diffs or patches.\n\n```go\ntype Blame struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (blame *Blame) Free() error\n```\n\n```go\nfunc (blame *Blame) HunkByIndex(index int) (BlameHunk, error)\n```\n\n```go\nfunc (blame *Blame) HunkByLine(lineno int) (BlameHunk, error)\n```\n\n```go\nfunc (blame *Blame) HunkCount() int\n```\n\n```go\ntype BlameHunk struct {\n\tLinesInHunk          uint16\n\tFinalCommitId        *Oid\n\tFinalStartLineNumber uint16\n\tFinalSignature       *Signature\n\tOrigCommitId         *Oid\n\tOrigPath             string\n\tOrigStartLineNumber  uint16\n\tOrigSignature        *Signature\n\tBoundary             bool\n}\n```\n\n```go\ntype BlameOptions struct {\n\tFlags              BlameOptionsFlag\n\tMinMatchCharacters uint16\n\tNewestCommit       *Oid\n\tOldestCommit       *Oid\n\tMinLine            uint32\n\tMaxLine            uint32\n}\n```\n\n```go\nfunc DefaultBlameOptions() (BlameOptions, error)\n```\n\n```go\ntype BlameOptionsFlag uint32\n```\n\n```go\nconst (\n\tBlameNormal                      BlameOptionsFlag = C.GIT_BLAME_NORMAL\n\tBlameTrackCopiesSameFile         BlameOptionsFlag = C.GIT_BLAME_TRACK_COPIES_SAME_FILE\n\tBlameTrackCopiesSameCommitMoves  BlameOptionsFlag = C.GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES\n\tBlameTrackCopiesSameCommitCopies BlameOptionsFlag = C.GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES\n\tBlameTrackCopiesAnyCommitCopies  BlameOptionsFlag = C.GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES\n\tBlameFirstParent                 BlameOptionsFlag = C.GIT_BLAME_FIRST_PARENT\n\tBlameUseMailmap                  BlameOptionsFlag = C.GIT_BLAME_USE_MAILMAP\n)\n```\n\n```go\ntype Blob struct {\n\tObject\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (b *Blob) AsObject() *Object\n```\n\n```go\nfunc (v *Blob) Contents() []byte\n```\n\n```go\nfunc (v *Blob) IsBinary() bool\n```\n\n```go\nfunc (v *Blob) Size() int64\n```\n\n```go\ntype BlobCallbackData struct {\n\tCallback BlobChunkCallback\n\tError    error\n}\n```\nDeprecated: BlobCallbackData is not used.\n\n```go\ntype BlobChunkCallback func(maxLen int) ([]byte, error)\n```\nDeprecated: BlobChunkCallback is not used.\n\n```go\ntype BlobWriteStream struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (stream *BlobWriteStream) Commit() (*Oid, error)\n```\n\n```go\nfunc (stream *BlobWriteStream) Free()\n```\n\n```go\nfunc (stream *BlobWriteStream) Write(p []byte) (int, error)\n```\nImplement io.Writer\n\n```go\ntype Branch struct {\n\t*Reference\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (b *Branch) Delete() error\n```\n\n```go\nfunc (b *Branch) IsHead() (bool, error)\n```\n\n```go\nfunc (b *Branch) Move(newBranchName string, force bool) (*Branch, error)\n```\n\n```go\nfunc (b *Branch) Name() (string, error)\n```\n\n```go\nfunc (b *Branch) SetUpstream(upstreamName string) error\n```\n\n```go\nfunc (b *Branch) Upstream() (*Reference, error)\n```\n\n```go\ntype BranchIterator struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (i *BranchIterator) ForEach(f BranchIteratorFunc) error\n```\n\n```go\nfunc (i *BranchIterator) Free()\n```\n\n```go\nfunc (i *BranchIterator) Next() (*Branch, BranchType, error)\n```\n\n```go\ntype BranchIteratorFunc func(*Branch, BranchType) error\n```\n\n```go\ntype BranchType uint\n```\n\n```go\nconst (\n\tBranchAll    BranchType = C.GIT_BRANCH_ALL\n\tBranchLocal  BranchType = C.GIT_BRANCH_LOCAL\n\tBranchRemote BranchType = C.GIT_BRANCH_REMOTE\n)\n```\n\n```go\ntype Certificate struct {\n\tKind    CertificateKind\n\tX509    *x509.Certificate\n\tHostkey HostkeyCertificate\n}\n```\nCertificate represents the two possible certificates which libgit2 knows it might find. If Kind is CertficateX509 then the X509 field will be filled. If Kind is CertificateHostkey then the Hostkey field will be fille.d\n\n```go\ntype CertificateCheckCallback func(cert *Certificate, valid bool, hostname string) ErrorCode\n```\n\n```go\ntype CertificateKind uint\n```\n\n```go\nconst (\n\tCertificateX509    CertificateKind = C.GIT_CERT_X509\n\tCertificateHostkey CertificateKind = C.GIT_CERT_HOSTKEY_LIBSSH2\n)\n```\n\n```go\ntype CheckoutNotifyCallback func(why CheckoutNotifyType, path string, baseline, target, workdir DiffFile) ErrorCode\n```\n\n```go\ntype CheckoutNotifyType uint\n```\n\n```go\ntype CheckoutOptions struct {\n\tStrategy         CheckoutStrategy   // Default will be a dry run\n\tDisableFilters   bool               // Don't apply filters like CRLF conversion\n\tDirMode          os.FileMode        // Default is 0755\n\tFileMode         os.FileMode        // Default is 0644 or 0755 as dictated by blob\n\tFileOpenFlags    int                // Default is O_CREAT | O_TRUNC | O_WRONLY\n\tNotifyFlags      CheckoutNotifyType // Default will be none\n\tNotifyCallback   CheckoutNotifyCallback\n\tProgressCallback CheckoutProgressCallback\n\tTargetDirectory  string // Alternative checkout path to workdir\n\tPaths            []string\n\tBaseline         *Tree\n}\n```\n\n```go\ntype CheckoutOpts = CheckoutOptions\n```\nDeprecated: CheckoutOpts is a deprecated alias of CheckoutOptions.\n\n```go\ntype CheckoutProgressCallback func(path string, completed, total uint) ErrorCode\n```\n\n```go\ntype CheckoutStrategy uint\n```\n\n```go\ntype CherrypickOptions struct {\n\tVersion      uint\n\tMainline     uint\n\tMergeOpts    MergeOptions\n\tCheckoutOpts CheckoutOptions\n}\n```\n\n```go\nfunc DefaultCherrypickOptions() (CherrypickOptions, error)\n```\n\n```go\ntype CloneOptions struct {\n\t*CheckoutOpts\n\t*FetchOptions\n\tBare                 bool\n\tCheckoutBranch       string\n\tRemoteCreateCallback RemoteCreateCallback\n}\n```\n\n```go\ntype Commit struct {\n\tObject\n\t// contains filtered or unexported fields\n}\n```\nCommit\n\n```go\nfunc (c *Commit) Amend(refname string, author, committer *Signature, message string, tree *Tree) (*Oid, error)\n```\n\n```go\nfunc (c *Commit) AsObject() *Object\n```\n\n```go\nfunc (c *Commit) Author() *Signature\n```\n\n```go\nfunc (c *Commit) Committer() *Signature\n```\n\n```go\nfunc (c *Commit) ContentToSign() string\n```\nContentToSign returns the content that will be passed to a signing function for this commit\n\n```go\nfunc (c *Commit) Describe(opts *DescribeOptions) (*DescribeResult, error)\n```\nDescribe performs the describe operation on the commit.\n\n```go\nfunc (c *Commit) ExtractSignature() (string, string, error)\n```\n\n```go\nfunc (c *Commit) Message() string\n```\n\n```go\nfunc (c *Commit) MessageEncoding() string\n```\n\n```go\nfunc (c *Commit) Parent(n uint) *Commit\n```\n\n```go\nfunc (c *Commit) ParentCount() uint\n```\n\n```go\nfunc (c *Commit) ParentId(n uint) *Oid\n```\n\n```go\nfunc (c *Commit) RawHeader() string\n```\nRawHeader gets the full raw text of the commit header.\n\n```go\nfunc (c *Commit) RawMessage() string\n```\n\n```go\nfunc (c *Commit) Summary() string\n```\n\n```go\nfunc (c *Commit) Tree() (*Tree, error)\n```\n\n```go\nfunc (c *Commit) TreeId() *Oid\n```\n\n```go\nfunc (c *Commit) WithSignature(signature string, signatureField string) (*Oid, error)\n```\nWithSignature creates a new signed commit from the given signature and signature field\n\n```go\nfunc (c *Commit) WithSignatureUsing(f CommitSigningCallback) (*Oid, error)\n```\nWithSignatureUsing creates a new signed commit from this one using the given signing callback\n\n```go\ntype CommitSigningCallback func(string) (signature, signatureField string, err error)\n```\nCommitSigningCallback defines a function type that takes some data to sign and returns (signature, signature\\_field, error)\n\n```go\ntype CompletionCallback func(RemoteCompletion) ErrorCode\n```\n\n```go\ntype Config struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewConfig() (*Config, error)\n```\nNewConfig creates a new empty configuration object\n\n```go\nfunc OpenDefault() (*Config, error)\n```\nOpenDefault opens the default config according to git rules\n\n```go\nfunc OpenOndisk(path string) (*Config, error)\n```\nOpenOndisk creates a new config instance containing a single on-disk file\n\n```go\nfunc (c *Config) AddFile(path string, level ConfigLevel, force bool) error\n```\nAddFile adds a file-backed backend to the config object at the specified level.\n\n```go\nfunc (c *Config) Delete(name string) error\n```\n\n```go\nfunc (c *Config) Free()\n```\n\n```go\nfunc (c *Config) LookupBool(name string) (bool, error)\n```\n\n```go\nfunc (c *Config) LookupInt32(name string) (int32, error)\n```\n\n```go\nfunc (c *Config) LookupInt64(name string) (int64, error)\n```\n\n```go\nfunc (c *Config) LookupString(name string) (string, error)\n```\n\n```go\nfunc (c *Config) NewIterator() (*ConfigIterator, error)\n```\nNewIterator creates an iterator over each entry in the configuration\n\n```go\nfunc (c *Config) NewIteratorGlob(regexp string) (*ConfigIterator, error)\n```\nNewIteratorGlob creates an iterator over each entry in the configuration whose name matches the given regular expression\n\n```go\nfunc (c *Config) NewMultivarIterator(name, regexp string) (*ConfigIterator, error)\n```\n\n```go\nfunc (c *Config) OpenLevel(parent *Config, level ConfigLevel) (*Config, error)\n```\nOpenLevel creates a single-level focused config object from a multi-level one\n\n```go\nfunc (c *Config) SetBool(name string, value bool) (err error)\n```\n\n```go\nfunc (c *Config) SetInt32(name string, value int32) (err error)\n```\n\n```go\nfunc (c *Config) SetInt64(name string, value int64) (err error)\n```\n\n```go\nfunc (c *Config) SetMultivar(name, regexp, value string) (err error)\n```\n\n```go\nfunc (c *Config) SetString(name, value string) (err error)\n```\n\n```go\ntype ConfigEntry struct {\n\tName  string\n\tValue string\n\tLevel ConfigLevel\n}\n```\n\n```go\ntype ConfigIterator struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (iter *ConfigIterator) Free()\n```\n\n```go\nfunc (iter *ConfigIterator) Next() (*ConfigEntry, error)\n```\nNext returns the next entry for this iterator\n\n```go\ntype ConfigLevel int\n```\n\n```go\nconst (\n\t// System-wide on Windows, for compatibility with portable git\n\tConfigLevelProgramdata ConfigLevel = C.GIT_CONFIG_LEVEL_PROGRAMDATA\n\n\t// System-wide configuration file; /etc/gitconfig on Linux systems\n\tConfigLevelSystem ConfigLevel = C.GIT_CONFIG_LEVEL_SYSTEM\n\n\t// XDG compatible configuration file; typically ~/.config/git/config\n\tConfigLevelXDG ConfigLevel = C.GIT_CONFIG_LEVEL_XDG\n\n\t// User-specific configuration file (also called Global configuration\n\t// file); typically ~/.gitconfig\n\tConfigLevelGlobal ConfigLevel = C.GIT_CONFIG_LEVEL_GLOBAL\n\n\t// Repository specific configuration file; $WORK_DIR/.git/config on\n\t// non-bare repos\n\tConfigLevelLocal ConfigLevel = C.GIT_CONFIG_LEVEL_LOCAL\n\n\t// Application specific configuration file; freely defined by applications\n\tConfigLevelApp ConfigLevel = C.GIT_CONFIG_LEVEL_APP\n\n\t// Represents the highest level available config file (i.e. the most\n\t// specific config file available that actually is loaded)\n\tConfigLevelHighest ConfigLevel = C.GIT_CONFIG_HIGHEST_LEVEL\n)\n```\n\n```go\ntype ConnectDirection uint\n```\n\n```go\ntype Cred struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewCredDefault() (int, Cred)\n```\n\n```go\nfunc NewCredSshKey(username string, publicKeyPath string, privateKeyPath string, passphrase string) (int, Cred)\n```\nNewCredSshKey creates new ssh credentials reading the public and private keys from the file system.\n\n```go\nfunc NewCredSshKeyFromAgent(username string) (int, Cred)\n```\n\n```go\nfunc NewCredSshKeyFromMemory(username string, publicKey string, privateKey string, passphrase string) (int, Cred)\n```\nNewCredSshKeyFromMemory creates new ssh credentials using the publicKey and privateKey arguments as the values for the public and private keys.\n\n```go\nfunc NewCredUsername(username string) (int, Cred)\n```\n\n```go\nfunc NewCredUserpassPlaintext(username string, password string) (int, Cred)\n```\n\n```go\nfunc NewCredentialSSHKeyFromSigner(username string, signer ssh.Signer) (*Cred, error)\n```\nNewCredentialSSHKeyFromSigner creates new SSH credentials using the provided signer.\n\n```go\nfunc (o *Cred) GetSSHKey() (username, publickey, privatekey, passphrase string, err error)\n```\nGetSSHKey returns the SSH-specific key information from the Cred object.\n\n```go\nfunc (o *Cred) GetUserpassPlaintext() (username, password string, err error)\n```\nGetUserpassPlaintext returns the plaintext username/password combination stored in the Cred.\n\n```go\nfunc (o *Cred) HasUsername() bool\n```\n\n```go\nfunc (o *Cred) Type() CredType\n```\n\n```go\ntype CredType uint\n```\n\n```go\nconst (\n\tCredTypeUserpassPlaintext CredType = C.GIT_CREDTYPE_USERPASS_PLAINTEXT\n\tCredTypeSshKey            CredType = C.GIT_CREDTYPE_SSH_KEY\n\tCredTypeSshCustom         CredType = C.GIT_CREDTYPE_SSH_CUSTOM\n\tCredTypeDefault           CredType = C.GIT_CREDTYPE_DEFAULT\n)\n```\n\n```go\ntype CredentialsCallback func(url string, username_from_url string, allowed_types CredType) (ErrorCode, *Cred)\n```\n\n```go\ntype Delta int\n```\n\n```go\nconst (\n\tDeltaUnmodified Delta = C.GIT_DELTA_UNMODIFIED\n\tDeltaAdded      Delta = C.GIT_DELTA_ADDED\n\tDeltaDeleted    Delta = C.GIT_DELTA_DELETED\n\tDeltaModified   Delta = C.GIT_DELTA_MODIFIED\n\tDeltaRenamed    Delta = C.GIT_DELTA_RENAMED\n\tDeltaCopied     Delta = C.GIT_DELTA_COPIED\n\tDeltaIgnored    Delta = C.GIT_DELTA_IGNORED\n\tDeltaUntracked  Delta = C.GIT_DELTA_UNTRACKED\n\tDeltaTypeChange Delta = C.GIT_DELTA_TYPECHANGE\n\tDeltaUnreadable Delta = C.GIT_DELTA_UNREADABLE\n\tDeltaConflicted Delta = C.GIT_DELTA_CONFLICTED\n)\n```\n\n```go\nfunc (i Delta) String() string\n```\n\n```go\ntype DescribeFormatOptions struct {\n\t// Size of the abbreviated commit id to use. This value is the\n\t// lower bound for the length of the abbreviated string.\n\tAbbreviatedSize uint // default: 7\n\n\t// Set to use the long format even when a shorter name could be used.\n\tAlwaysUseLongFormat bool\n\n\t// If the workdir is dirty and this is set, this string will be\n\t// appended to the description string.\n\tDirtySuffix string\n}\n```\nDescribeFormatOptions can be used for formatting the describe string.\n\nYou can use DefaultDescribeFormatOptions() to get default options.\n\n```go\nfunc DefaultDescribeFormatOptions() (DescribeFormatOptions, error)\n```\nDefaultDescribeFormatOptions returns default options for formatting the output.\n\n```go\ntype DescribeOptions struct {\n\t// How many tags as candidates to consider to describe the input commit-ish.\n\t// Increasing it above 10 will take slightly longer but may produce a more\n\t// accurate result. 0 will cause only exact matches to be output.\n\tMaxCandidatesTags uint // default: 10\n\n\t// By default describe only shows annotated tags. Change this in order\n\t// to show all refs from refs/tags or refs/.\n\tStrategy DescribeOptionsStrategy // default: DescribeDefault\n\n\t// Only consider tags matching the given glob(7) pattern, excluding\n\t// the \"refs/tags/\" prefix. Can be used to avoid leaking private\n\t// tags from the repo.\n\tPattern string\n\n\t// When calculating the distance from the matching tag or\n\t// reference, only walk down the first-parent ancestry.\n\tOnlyFollowFirstParent bool\n\n\t// If no matching tag or reference is found, the describe\n\t// operation would normally fail. If this option is set, it\n\t// will instead fall back to showing the full id of the commit.\n\tShowCommitOidAsFallback bool\n}\n```\nDescribeOptions represents the describe operation configuration.\n\nYou can use DefaultDescribeOptions() to get default options.\n\n```go\nfunc DefaultDescribeOptions() (DescribeOptions, error)\n```\nDefaultDescribeOptions returns default options for the describe operation.\n\n```go\ntype DescribeOptionsStrategy uint\n```\nDescribeOptionsStrategy behaves like the --tags and --all options to git-describe, namely they say to look for any reference in either refs/tags/ or refs/ respectively.\n\nBy default it only shows annotated tags.\n\n```go\nconst (\n\tDescribeDefault DescribeOptionsStrategy = C.GIT_DESCRIBE_DEFAULT\n\tDescribeTags    DescribeOptionsStrategy = C.GIT_DESCRIBE_TAGS\n\tDescribeAll     DescribeOptionsStrategy = C.GIT_DESCRIBE_ALL\n)\n```\nDescribe strategy options.\n\n```go\ntype DescribeResult struct {\n\t// contains filtered or unexported fields\n}\n```\nDescribeResult represents the output from the 'git\\_describe\\_commit' and 'git\\_describe\\_workdir' functions in libgit2.\n\nUse Format() to get a string out of it.\n\n```go\nfunc (result *DescribeResult) Format(opts *DescribeFormatOptions) (string, error)\n```\nFormat prints the DescribeResult as a string.\n\n```go\nfunc (result *DescribeResult) Free()\n```\nFree cleans up the C reference.\n\n```go\ntype Diff struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc DiffFromBuffer(buffer []byte, repo *Repository) (*Diff, error)\n```\nDiffFromBuffer reads the contents of a git patch file into a Diff object.\n\nThe diff object produced is similar to the one that would be produced if you actually produced it computationally by comparing two trees, however there may be subtle differences. For example, a patch file likely contains abbreviated object IDs, so the object IDs in a git\\_diff\\_delta produced by this function will also be abbreviated.\n\nThis function will only read patch files created by a git implementation, it will not read unified diffs produced by the diff program, nor any other types of patch files.\n\n```go\nfunc (diff *Diff) Delta(index int) (DiffDelta, error)\n```\n\n```go\nfunc (diff *Diff) FindSimilar(opts *DiffFindOptions) error\n```\n\n```go\nfunc (diff *Diff) ForEach(cbFile DiffForEachFileCallback, detail DiffDetail) error\n```\n\n```go\nfunc (diff *Diff) Free() error\n```\n\n```go\nfunc (diff *Diff) GetDelta(index int) (DiffDelta, error)\n```\ndeprecated: You should use \\`Diff.Delta()\\` instead.\n\n```go\nfunc (diff *Diff) NumDeltas() (int, error)\n```\n\n```go\nfunc (diff *Diff) Patch(deltaIndex int) (*Patch, error)\n```\n\n```go\nfunc (diff *Diff) Stats() (*DiffStats, error)\n```\n\n```go\nfunc (diff *Diff) ToBuf(format DiffFormat) ([]byte, error)\n```\n\n```go\ntype DiffDelta struct {\n\tStatus     Delta\n\tFlags      DiffFlag\n\tSimilarity uint16\n\tOldFile    DiffFile\n\tNewFile    DiffFile\n}\n```\n\n```go\ntype DiffDetail int\n```\n\n```go\nconst (\n\tDiffDetailFiles DiffDetail = iota\n\tDiffDetailHunks\n\tDiffDetailLines\n)\n```\n\n```go\ntype DiffFile struct {\n\tPath  string\n\tOid   *Oid\n\tSize  int\n\tFlags DiffFlag\n\tMode  uint16\n}\n```\n\n```go\ntype DiffFindOptions struct {\n\tFlags                      DiffFindOptionsFlag\n\tRenameThreshold            uint16\n\tCopyThreshold              uint16\n\tRenameFromRewriteThreshold uint16\n\tBreakRewriteThreshold      uint16\n\tRenameLimit                uint\n}\n```\nTODO implement git\\_diff\\_similarity\\_metric\n\n```go\nfunc DefaultDiffFindOptions() (DiffFindOptions, error)\n```\n\n```go\ntype DiffFindOptionsFlag int\n```\n\n```go\nconst (\n\tDiffFindByConfig                    DiffFindOptionsFlag = C.GIT_DIFF_FIND_BY_CONFIG\n\tDiffFindRenames                     DiffFindOptionsFlag = C.GIT_DIFF_FIND_RENAMES\n\tDiffFindRenamesFromRewrites         DiffFindOptionsFlag = C.GIT_DIFF_FIND_RENAMES_FROM_REWRITES\n\tDiffFindCopies                      DiffFindOptionsFlag = C.GIT_DIFF_FIND_COPIES\n\tDiffFindCopiesFromUnmodified        DiffFindOptionsFlag = C.GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED\n\tDiffFindRewrites                    DiffFindOptionsFlag = C.GIT_DIFF_FIND_REWRITES\n\tDiffFindBreakRewrites               DiffFindOptionsFlag = C.GIT_DIFF_BREAK_REWRITES\n\tDiffFindAndBreakRewrites            DiffFindOptionsFlag = C.GIT_DIFF_FIND_AND_BREAK_REWRITES\n\tDiffFindForUntracked                DiffFindOptionsFlag = C.GIT_DIFF_FIND_FOR_UNTRACKED\n\tDiffFindAll                         DiffFindOptionsFlag = C.GIT_DIFF_FIND_ALL\n\tDiffFindIgnoreLeadingWhitespace     DiffFindOptionsFlag = C.GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE\n\tDiffFindIgnoreWhitespace            DiffFindOptionsFlag = C.GIT_DIFF_FIND_IGNORE_WHITESPACE\n\tDiffFindDontIgnoreWhitespace        DiffFindOptionsFlag = C.GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE\n\tDiffFindExactMatchOnly              DiffFindOptionsFlag = C.GIT_DIFF_FIND_EXACT_MATCH_ONLY\n\tDiffFindBreakRewritesForRenamesOnly DiffFindOptionsFlag = C.GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY\n\tDiffFindRemoveUnmodified            DiffFindOptionsFlag = C.GIT_DIFF_FIND_REMOVE_UNMODIFIED\n)\n```\n\n```go\ntype DiffFlag uint32\n```\n\n```go\nconst (\n\tDiffFlagBinary    DiffFlag = C.GIT_DIFF_FLAG_BINARY\n\tDiffFlagNotBinary DiffFlag = C.GIT_DIFF_FLAG_NOT_BINARY\n\tDiffFlagValidOid  DiffFlag = C.GIT_DIFF_FLAG_VALID_ID\n\tDiffFlagExists    DiffFlag = C.GIT_DIFF_FLAG_EXISTS\n)\n```\n\n```go\ntype DiffForEachFileCallback func(delta DiffDelta, progress float64) (DiffForEachHunkCallback, error)\n```\n\n```go\ntype DiffForEachHunkCallback func(DiffHunk) (DiffForEachLineCallback, error)\n```\n\n```go\ntype DiffForEachLineCallback func(DiffLine) error\n```\n\n```go\ntype DiffFormat int\n```\n\n```go\nconst (\n\tDiffFormatPatch       DiffFormat = C.GIT_DIFF_FORMAT_PATCH\n\tDiffFormatPatchHeader DiffFormat = C.GIT_DIFF_FORMAT_PATCH_HEADER\n\tDiffFormatRaw         DiffFormat = C.GIT_DIFF_FORMAT_RAW\n\tDiffFormatNameOnly    DiffFormat = C.GIT_DIFF_FORMAT_NAME_ONLY\n\tDiffFormatNameStatus  DiffFormat = C.GIT_DIFF_FORMAT_NAME_STATUS\n)\n```\n\n```go\ntype DiffHunk struct {\n\tOldStart int\n\tOldLines int\n\tNewStart int\n\tNewLines int\n\tHeader   string\n}\n```\n\n```go\ntype DiffLine struct {\n\tOrigin    DiffLineType\n\tOldLineno int\n\tNewLineno int\n\tNumLines  int\n\tContent   string\n}\n```\n\n```go\ntype DiffLineType int\n```\n\n```go\nconst (\n\tDiffLineContext      DiffLineType = C.GIT_DIFF_LINE_CONTEXT\n\tDiffLineAddition     DiffLineType = C.GIT_DIFF_LINE_ADDITION\n\tDiffLineDeletion     DiffLineType = C.GIT_DIFF_LINE_DELETION\n\tDiffLineContextEOFNL DiffLineType = C.GIT_DIFF_LINE_CONTEXT_EOFNL\n\tDiffLineAddEOFNL     DiffLineType = C.GIT_DIFF_LINE_ADD_EOFNL\n\tDiffLineDelEOFNL     DiffLineType = C.GIT_DIFF_LINE_DEL_EOFNL\n\n\tDiffLineFileHdr DiffLineType = C.GIT_DIFF_LINE_FILE_HDR\n\tDiffLineHunkHdr DiffLineType = C.GIT_DIFF_LINE_HUNK_HDR\n\tDiffLineBinary  DiffLineType = C.GIT_DIFF_LINE_BINARY\n)\n```\n\n```go\nfunc (i DiffLineType) String() string\n```\n\n```go\ntype DiffNotifyCallback func(diffSoFar *Diff, deltaToAdd DiffDelta, matchedPathspec string) error\n```\n\n```go\ntype DiffOptions struct {\n\tFlags            DiffOptionsFlag\n\tIgnoreSubmodules SubmoduleIgnore\n\tPathspec         []string\n\tNotifyCallback   DiffNotifyCallback\n\n\tContextLines   uint32\n\tInterhunkLines uint32\n\tIdAbbrev       uint16\n\n\tMaxSize int\n\n\tOldPrefix string\n\tNewPrefix string\n}\n```\n\n```go\nfunc DefaultDiffOptions() (DiffOptions, error)\n```\n\n```go\ntype DiffOptionsFlag int\n```\n\n```go\nconst (\n\tDiffNormal                 DiffOptionsFlag = C.GIT_DIFF_NORMAL\n\tDiffReverse                DiffOptionsFlag = C.GIT_DIFF_REVERSE\n\tDiffIncludeIgnored         DiffOptionsFlag = C.GIT_DIFF_INCLUDE_IGNORED\n\tDiffRecurseIgnoredDirs     DiffOptionsFlag = C.GIT_DIFF_RECURSE_IGNORED_DIRS\n\tDiffIncludeUntracked       DiffOptionsFlag = C.GIT_DIFF_INCLUDE_UNTRACKED\n\tDiffRecurseUntracked       DiffOptionsFlag = C.GIT_DIFF_RECURSE_UNTRACKED_DIRS\n\tDiffIncludeUnmodified      DiffOptionsFlag = C.GIT_DIFF_INCLUDE_UNMODIFIED\n\tDiffIncludeTypeChange      DiffOptionsFlag = C.GIT_DIFF_INCLUDE_TYPECHANGE\n\tDiffIncludeTypeChangeTrees DiffOptionsFlag = C.GIT_DIFF_INCLUDE_TYPECHANGE_TREES\n\tDiffIgnoreFilemode         DiffOptionsFlag = C.GIT_DIFF_IGNORE_FILEMODE\n\tDiffIgnoreSubmodules       DiffOptionsFlag = C.GIT_DIFF_IGNORE_SUBMODULES\n\tDiffIgnoreCase             DiffOptionsFlag = C.GIT_DIFF_IGNORE_CASE\n\tDiffIncludeCaseChange      DiffOptionsFlag = C.GIT_DIFF_INCLUDE_CASECHANGE\n\n\tDiffDisablePathspecMatch    DiffOptionsFlag = C.GIT_DIFF_DISABLE_PATHSPEC_MATCH\n\tDiffSkipBinaryCheck         DiffOptionsFlag = C.GIT_DIFF_SKIP_BINARY_CHECK\n\tDiffEnableFastUntrackedDirs DiffOptionsFlag = C.GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS\n\n\tDiffForceText   DiffOptionsFlag = C.GIT_DIFF_FORCE_TEXT\n\tDiffForceBinary DiffOptionsFlag = C.GIT_DIFF_FORCE_BINARY\n\n\tDiffIgnoreWhitespace       DiffOptionsFlag = C.GIT_DIFF_IGNORE_WHITESPACE\n\tDiffIgnoreWhitespaceChange DiffOptionsFlag = C.GIT_DIFF_IGNORE_WHITESPACE_CHANGE\n\tDiffIgnoreWhitespaceEOL    DiffOptionsFlag = C.GIT_DIFF_IGNORE_WHITESPACE_EOL\n\n\tDiffShowUntrackedContent DiffOptionsFlag = C.GIT_DIFF_SHOW_UNTRACKED_CONTENT\n\tDiffShowUnmodified       DiffOptionsFlag = C.GIT_DIFF_SHOW_UNMODIFIED\n\tDiffPatience             DiffOptionsFlag = C.GIT_DIFF_PATIENCE\n\tDiffMinimal              DiffOptionsFlag = C.GIT_DIFF_MINIMAL\n\tDiffShowBinary           DiffOptionsFlag = C.GIT_DIFF_SHOW_BINARY\n\tDiffIndentHeuristic      DiffOptionsFlag = C.GIT_DIFF_INDENT_HEURISTIC\n)\n```\n\n```go\ntype DiffStats struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (stats *DiffStats) Deletions() int\n```\n\n```go\nfunc (stats *DiffStats) FilesChanged() int\n```\n\n```go\nfunc (stats *DiffStats) Free() error\n```\n\n```go\nfunc (stats *DiffStats) Insertions() int\n```\n\n```go\nfunc (stats *DiffStats) String(format DiffStatsFormat,\n\twidth uint) (string, error)\n```\n\n```go\ntype DiffStatsFormat int\n```\n\n```go\nconst (\n\tDiffStatsNone           DiffStatsFormat = C.GIT_DIFF_STATS_NONE\n\tDiffStatsFull           DiffStatsFormat = C.GIT_DIFF_STATS_FULL\n\tDiffStatsShort          DiffStatsFormat = C.GIT_DIFF_STATS_SHORT\n\tDiffStatsNumber         DiffStatsFormat = C.GIT_DIFF_STATS_NUMBER\n\tDiffStatsIncludeSummary DiffStatsFormat = C.GIT_DIFF_STATS_INCLUDE_SUMMARY\n)\n```\n\n```go\ntype DownloadTags uint\n```\n\n```go\nconst (\n\t// Use the setting from the configuration.\n\tDownloadTagsUnspecified DownloadTags = C.GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED\n\t// Ask the server for tags pointing to objects we're already\n\t// downloading.\n\tDownloadTagsAuto DownloadTags = C.GIT_REMOTE_DOWNLOAD_TAGS_AUTO\n\n\t// Don't ask for any tags beyond the refspecs.\n\tDownloadTagsNone DownloadTags = C.GIT_REMOTE_DOWNLOAD_TAGS_NONE\n\n\t// Ask for the all the tags.\n\tDownloadTagsAll DownloadTags = C.GIT_REMOTE_DOWNLOAD_TAGS_ALL\n)\n```\n\n```go\ntype ErrorClass int\n```\n\n```go\nconst (\n\tErrorClassNone       ErrorClass = C.GIT_ERROR_NONE\n\tErrorClassNoMemory   ErrorClass = C.GIT_ERROR_NOMEMORY\n\tErrorClassOS         ErrorClass = C.GIT_ERROR_OS\n\tErrorClassInvalid    ErrorClass = C.GIT_ERROR_INVALID\n\tErrorClassReference  ErrorClass = C.GIT_ERROR_REFERENCE\n\tErrorClassZlib       ErrorClass = C.GIT_ERROR_ZLIB\n\tErrorClassRepository ErrorClass = C.GIT_ERROR_REPOSITORY\n\tErrorClassConfig     ErrorClass = C.GIT_ERROR_CONFIG\n\tErrorClassRegex      ErrorClass = C.GIT_ERROR_REGEX\n\tErrorClassOdb        ErrorClass = C.GIT_ERROR_ODB\n\tErrorClassIndex      ErrorClass = C.GIT_ERROR_INDEX\n\tErrorClassObject     ErrorClass = C.GIT_ERROR_OBJECT\n\tErrorClassNet        ErrorClass = C.GIT_ERROR_NET\n\tErrorClassTag        ErrorClass = C.GIT_ERROR_TAG\n\tErrorClassTree       ErrorClass = C.GIT_ERROR_TREE\n\tErrorClassIndexer    ErrorClass = C.GIT_ERROR_INDEXER\n\tErrorClassSSL        ErrorClass = C.GIT_ERROR_SSL\n\tErrorClassSubmodule  ErrorClass = C.GIT_ERROR_SUBMODULE\n\tErrorClassThread     ErrorClass = C.GIT_ERROR_THREAD\n\tErrorClassStash      ErrorClass = C.GIT_ERROR_STASH\n\tErrorClassCheckout   ErrorClass = C.GIT_ERROR_CHECKOUT\n\tErrorClassFetchHead  ErrorClass = C.GIT_ERROR_FETCHHEAD\n\tErrorClassMerge      ErrorClass = C.GIT_ERROR_MERGE\n\tErrorClassSSH        ErrorClass = C.GIT_ERROR_SSH\n\tErrorClassFilter     ErrorClass = C.GIT_ERROR_FILTER\n\tErrorClassRevert     ErrorClass = C.GIT_ERROR_REVERT\n\tErrorClassCallback   ErrorClass = C.GIT_ERROR_CALLBACK\n\tErrorClassRebase     ErrorClass = C.GIT_ERROR_REBASE\n\tErrorClassPatch      ErrorClass = C.GIT_ERROR_PATCH\n)\n```\n\n```go\nfunc (i ErrorClass) String() string\n```\n\n```go\ntype ErrorCode int\n```\n\n```go\nconst (\n\t// ErrorCodeOK indicates that the operation completed successfully.\n\tErrorCodeOK ErrorCode = C.GIT_OK\n\n\t// ErrorCodeGeneric represents a generic error.\n\tErrorCodeGeneric ErrorCode = C.GIT_ERROR\n\t// ErrorCodeNotFound represents that the requested object could not be found\n\tErrorCodeNotFound ErrorCode = C.GIT_ENOTFOUND\n\t// ErrorCodeExists represents that the object exists preventing operation.\n\tErrorCodeExists ErrorCode = C.GIT_EEXISTS\n\t// ErrorCodeAmbiguous represents that more than one object matches.\n\tErrorCodeAmbiguous ErrorCode = C.GIT_EAMBIGUOUS\n\t// ErrorCodeBuffs represents that the output buffer is too short to hold data.\n\tErrorCodeBuffs ErrorCode = C.GIT_EBUFS\n\n\t// ErrorCodeUser is a special error that is never generated by libgit2\n\t// code.  You can return it from a callback (e.g to stop an iteration)\n\t// to know that it was generated by the callback and not by libgit2.\n\tErrorCodeUser ErrorCode = C.GIT_EUSER\n\n\t// ErrorCodeBareRepo represents that the operation not allowed on bare repository\n\tErrorCodeBareRepo ErrorCode = C.GIT_EBAREREPO\n\t// ErrorCodeUnbornBranch represents that HEAD refers to branch with no commits.\n\tErrorCodeUnbornBranch ErrorCode = C.GIT_EUNBORNBRANCH\n\t// ErrorCodeUnmerged represents that a merge in progress prevented operation.\n\tErrorCodeUnmerged ErrorCode = C.GIT_EUNMERGED\n\t// ErrorCodeNonFastForward represents that the reference was not fast-forwardable.\n\tErrorCodeNonFastForward ErrorCode = C.GIT_ENONFASTFORWARD\n\t// ErrorCodeInvalidSpec represents that the name/ref spec was not in a valid format.\n\tErrorCodeInvalidSpec ErrorCode = C.GIT_EINVALIDSPEC\n\t// ErrorCodeConflict represents that checkout conflicts prevented operation.\n\tErrorCodeConflict ErrorCode = C.GIT_ECONFLICT\n\t// ErrorCodeLocked represents that lock file prevented operation.\n\tErrorCodeLocked ErrorCode = C.GIT_ELOCKED\n\t// ErrorCodeModified represents that the reference value does not match expected.\n\tErrorCodeModified ErrorCode = C.GIT_EMODIFIED\n\t// ErrorCodeAuth represents that the authentication failed.\n\tErrorCodeAuth ErrorCode = C.GIT_EAUTH\n\t// ErrorCodeCertificate represents that the server certificate is invalid.\n\tErrorCodeCertificate ErrorCode = C.GIT_ECERTIFICATE\n\t// ErrorCodeApplied represents that the patch/merge has already been applied.\n\tErrorCodeApplied ErrorCode = C.GIT_EAPPLIED\n\t// ErrorCodePeel represents that the requested peel operation is not possible.\n\tErrorCodePeel ErrorCode = C.GIT_EPEEL\n\t// ErrorCodeEOF represents an unexpected EOF.\n\tErrorCodeEOF ErrorCode = C.GIT_EEOF\n\t// ErrorCodeInvalid represents an invalid operation or input.\n\tErrorCodeInvalid ErrorCode = C.GIT_EINVALID\n\t// ErrorCodeUIncommitted represents that uncommitted changes in index prevented operation.\n\tErrorCodeUncommitted ErrorCode = C.GIT_EUNCOMMITTED\n\t// ErrorCodeDirectory represents that the operation is not valid for a directory.\n\tErrorCodeDirectory ErrorCode = C.GIT_EDIRECTORY\n\t// ErrorCodeMergeConflict represents that a merge conflict exists and cannot continue.\n\tErrorCodeMergeConflict ErrorCode = C.GIT_EMERGECONFLICT\n\n\t// ErrorCodePassthrough represents that a user-configured callback refused to act.\n\tErrorCodePassthrough ErrorCode = C.GIT_PASSTHROUGH\n\t// ErrorCodeIterOver signals end of iteration with iterator.\n\tErrorCodeIterOver ErrorCode = C.GIT_ITEROVER\n\t// ErrorCodeRetry is an internal-only error code.\n\tErrorCodeRetry ErrorCode = C.GIT_RETRY\n\t// ErrorCodeMismatch represents a hashsum mismatch in object.\n\tErrorCodeMismatch ErrorCode = C.GIT_EMISMATCH\n\t// ErrorCodeIndexDirty represents that unsaved changes in the index would be overwritten.\n\tErrorCodeIndexDirty ErrorCode = C.GIT_EINDEXDIRTY\n\t// ErrorCodeApplyFail represents that a patch application failed.\n\tErrorCodeApplyFail ErrorCode = C.GIT_EAPPLYFAIL\n)\n```\n\n```go\nfunc (i ErrorCode) String() string\n```\n\n```go\ntype Feature int\n```\n\n```go\nconst (\n\t// libgit2 was built with threading support\n\tFeatureThreads Feature = C.GIT_FEATURE_THREADS\n\n\t// libgit2 was built with HTTPS support built-in\n\tFeatureHTTPS Feature = C.GIT_FEATURE_HTTPS\n\n\t// libgit2 was build with SSH support built-in\n\tFeatureSSH Feature = C.GIT_FEATURE_SSH\n\n\t// libgit2 was built with nanosecond support for files\n\tFeatureNSec Feature = C.GIT_FEATURE_NSEC\n)\n```\n\n```go\nfunc Features() Feature\n```\nFeatures returns a bit-flag of Feature values indicating which features the loaded libgit2 library has.\n\n```go\ntype FetchOptions struct {\n\t// Callbacks to use for this fetch operation\n\tRemoteCallbacks RemoteCallbacks\n\t// Whether to perform a prune after the fetch\n\tPrune FetchPrune\n\t// Whether to write the results to FETCH_HEAD. Defaults to\n\t// on. Leave this default in order to behave like git.\n\tUpdateFetchhead bool\n\n\t// Determines how to behave regarding tags on the remote, such\n\t// as auto-downloading tags for objects we're downloading or\n\t// downloading all of them.\n\t//\n\t// The default is to auto-follow tags.\n\tDownloadTags DownloadTags\n\n\t// Headers are extra headers for the fetch operation.\n\tHeaders []string\n\n\t// Proxy options to use for this fetch operation\n\tProxyOptions ProxyOptions\n}\n```\n\n```go\ntype FetchPrune uint\n```\n\n```go\nconst (\n\t// Use the setting from the configuration\n\tFetchPruneUnspecified FetchPrune = C.GIT_FETCH_PRUNE_UNSPECIFIED\n\t// Force pruning on\n\tFetchPruneOn FetchPrune = C.GIT_FETCH_PRUNE\n\t// Force pruning off\n\tFetchNoPrune FetchPrune = C.GIT_FETCH_NO_PRUNE\n)\n```\n\n```go\ntype Filemode int\n```\n\n```go\nconst (\n\tFilemodeTree           Filemode = C.GIT_FILEMODE_TREE\n\tFilemodeBlob           Filemode = C.GIT_FILEMODE_BLOB\n\tFilemodeBlobExecutable Filemode = C.GIT_FILEMODE_BLOB_EXECUTABLE\n\tFilemodeLink           Filemode = C.GIT_FILEMODE_LINK\n\tFilemodeCommit         Filemode = C.GIT_FILEMODE_COMMIT\n)\n```\n\n```go\ntype GitError struct {\n\tMessage string\n\tClass   ErrorClass\n\tCode    ErrorCode\n}\n```\n\n```go\nfunc (e GitError) Error() string\n```\n\n```go\ntype HandleList struct {\n\tsync.RWMutex\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewHandleList() *HandleList\n```\n\n```go\nfunc (v *HandleList) Clear()\n```\nClear stops tracking all the managed pointers.\n\n```go\nfunc (v *HandleList) Get(handle unsafe.Pointer) interface{}\n```\nGet retrieves the pointer from the given handle\n\n```go\nfunc (v *HandleList) Track(pointer interface{}) unsafe.Pointer\n```\nTrack adds the given pointer to the list of pointers to track and returns a pointer value which can be passed to C as an opaque pointer.\n\n```go\nfunc (v *HandleList) Untrack(handle unsafe.Pointer)\n```\nUntrack stops tracking the pointer given by the handle\n\n```go\ntype HostkeyCertificate struct {\n\tKind         HostkeyKind\n\tHashMD5      [16]byte\n\tHashSHA1     [20]byte\n\tHashSHA256   [32]byte\n\tHostkey      []byte\n\tSSHPublicKey ssh.PublicKey\n}\n```\nServer host key information. A bitmask containing the available fields. Check for combinations of: HostkeyMD5, HostkeySHA1, HostkeySHA256, HostkeyRaw.\n\n```go\ntype HostkeyKind uint\n```\nHostkeyKind is a bitmask of the available hashes in HostkeyCertificate.\n\n```go\nconst (\n\tHostkeyMD5    HostkeyKind = C.GIT_CERT_SSH_MD5\n\tHostkeySHA1   HostkeyKind = C.GIT_CERT_SSH_SHA1\n\tHostkeySHA256 HostkeyKind = 1 \u003c\u003c 2\n\tHostkeyRaw    HostkeyKind = 1 \u003c\u003c 3\n)\n```\n\n```go\ntype Index struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewIndex() (*Index, error)\n```\nNewIndex allocates a new index. It won't be associated with any file on the filesystem or repository\n\n```go\nfunc OpenIndex(path string) (*Index, error)\n```\nOpenIndex creates a new index at the given path. If the file does not exist it will be created when Write() is called.\n\n```go\nfunc (v *Index) Add(entry *IndexEntry) error\n```\nAdd adds or replaces the given entry to the index, making a copy of the data\n\n```go\nfunc (v *Index) AddAll(pathspecs []string, flags IndexAddOption, callback IndexMatchedPathCallback) error\n```\n\n```go\nfunc (v *Index) AddByPath(path string) error\n```\n\n```go\nfunc (v *Index) AddConflict(ancestor *IndexEntry, our *IndexEntry, their *IndexEntry) error\n```\n\n```go\nfunc (v *Index) AddFromBuffer(entry *IndexEntry, buffer []byte) error\n```\nAddFromBuffer adds or replaces an index entry from a buffer in memory\n\n```go\nfunc (v *Index) CleanupConflicts()\n```\nFIXME: this might return an error\n\n```go\nfunc (v *Index) Clear() error\n```\nClear clears the index object in memory; changes must be explicitly written to disk for them to take effect persistently\n\n```go\nfunc (v *Index) Conflict(path string) (IndexConflict, error)\n```\n\n```go\nfunc (v *Index) ConflictIterator() (*IndexConflictIterator, error)\n```\n\n```go\nfunc (v *Index) EntryByIndex(index uint) (*IndexEntry, error)\n```\n\n```go\nfunc (v *Index) EntryByPath(path string, stage int) (*IndexEntry, error)\n```\n\n```go\nfunc (v *Index) EntryCount() uint\n```\n\n```go\nfunc (v *Index) Find(path string) (uint, error)\n```\n\n```go\nfunc (v *Index) FindPrefix(prefix string) (uint, error)\n```\n\n```go\nfunc (v *Index) Free()\n```\n\n```go\nfunc (v *Index) GetConflict(path string) (IndexConflict, error)\n```\ndeprecated: You should use \\`Index.Conflict()\\` instead.\n\n```go\nfunc (v *Index) HasConflicts() bool\n```\n\n```go\nfunc (v *Index) Path() string\n```\nPath returns the index' path on disk or an empty string if it exists only in memory.\n\n```go\nfunc (v *Index) ReadTree(tree *Tree) error\n```\nReadTree replaces the contents of the index with those of the given tree\n\n```go\nfunc (v *Index) RemoveAll(pathspecs []string, callback IndexMatchedPathCallback) error\n```\n\n```go\nfunc (v *Index) RemoveByPath(path string) error\n```\n\n```go\nfunc (v *Index) RemoveConflict(path string) error\n```\n\n```go\nfunc (v *Index) RemoveDirectory(dir string, stage int) error\n```\nRemoveDirectory removes all entries from the index under a given directory.\n\n```go\nfunc (v *Index) UpdateAll(pathspecs []string, callback IndexMatchedPathCallback) error\n```\n\n```go\nfunc (v *Index) Write() error\n```\n\n```go\nfunc (v *Index) WriteTree() (*Oid, error)\n```\n\n```go\nfunc (v *Index) WriteTreeTo(repo *Repository) (*Oid, error)\n```\n\n```go\ntype IndexAddOption uint\n```\nIndexAddOption is a set of flags for APIs that add files matching pathspec.\n\n```go\nconst (\n\tIndexAddDefault              IndexAddOption = C.GIT_INDEX_ADD_DEFAULT\n\tIndexAddForce                IndexAddOption = C.GIT_INDEX_ADD_FORCE\n\tIndexAddDisablePathspecMatch IndexAddOption = C.GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH\n\tIndexAddCheckPathspec        IndexAddOption = C.GIT_INDEX_ADD_CHECK_PATHSPEC\n)\n```\n\n```go\ntype IndexAddOpts = IndexAddOption\n```\nDeprecated: IndexAddOpts is a deprecated alias of IndexAddOption.\n\n```go\ntype IndexConflict struct {\n\tAncestor *IndexEntry\n\tOur      *IndexEntry\n\tTheir    *IndexEntry\n}\n```\n\n```go\ntype IndexConflictIterator struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (v *IndexConflictIterator) Free()\n```\n\n```go\nfunc (v *IndexConflictIterator) Index() *Index\n```\n\n```go\nfunc (v *IndexConflictIterator) Next() (IndexConflict, error)\n```\n\n```go\ntype IndexEntry struct {\n\tCtime IndexTime\n\tMtime IndexTime\n\tMode  Filemode\n\tUid   uint32\n\tGid   uint32\n\tSize  uint32\n\tId    *Oid\n\tPath  string\n}\n```\n\n```go\ntype IndexMatchedPathCallback func(string, string) int\n```\n\n```go\ntype IndexStageOpts = IndexStageState\n```\nDeprecated: IndexStageOpts is a deprecated alias of IndexStageState.\n\n```go\ntype IndexStageState int\n```\nIndexStageState indicates the state of the git index.\n\n```go\nconst (\n\t// IndexStageAny matches any index stage.\n\t//\n\t// Some index APIs take a stage to match; pass this value to match\n\t// any entry matching the path regardless of stage.\n\tIndexStageAny IndexStageState = C.GIT_INDEX_STAGE_ANY\n\t// IndexStageNormal is a normal staged file in the index.\n\tIndexStageNormal IndexStageState = C.GIT_INDEX_STAGE_NORMAL\n\t// IndexStageAncestor is the ancestor side of a conflict.\n\tIndexStageAncestor IndexStageState = C.GIT_INDEX_STAGE_ANCESTOR\n\t// IndexStageOurs is the \"ours\" side of a conflict.\n\tIndexStageOurs IndexStageState = C.GIT_INDEX_STAGE_OURS\n\t// IndexStageTheirs is the \"theirs\" side of a conflict.\n\tIndexStageTheirs IndexStageState = C.GIT_INDEX_STAGE_THEIRS\n)\n```\n\n```go\ntype IndexTime struct {\n\tSeconds     int32\n\tNanoseconds uint32\n}\n```\n\n```go\ntype Indexer struct {\n\t// contains filtered or unexported fields\n}\n```\nIndexer can post-process packfiles and create an .idx file for efficient lookup.\n\n```go\nfunc NewIndexer(packfilePath string, odb *Odb, callback TransferProgressCallback) (indexer *Indexer, err error)\n```\nNewIndexer creates a new indexer instance.\n\n```go\nfunc (indexer *Indexer) Commit() (*Oid, error)\n```\nCommit finalizes the pack and index. It resolves any pending deltas and writes out the index file.\n\nIt also returns the packfile's hash. A packfile's name is derived from the sorted hashing of all object names.\n\n```go\nfunc (indexer *Indexer) Free()\n```\nFree frees the indexer and its resources.\n\n```go\nfunc (indexer *Indexer) Write(data []byte) (int, error)\n```\nWrite adds data to the indexer.\n\n```go\ntype Mempack struct {\n\t// contains filtered or unexported fields\n}\n```\nMempack is a custom ODB backend that permits packing object in-memory.\n\n```go\nfunc NewMempack(odb *Odb) (mempack *Mempack, err error)\n```\nNewMempack creates a new mempack instance and registers it to the ODB.\n\n```go\nfunc (mempack *Mempack) Dump(repository *Repository) ([]byte, error)\n```\nDump dumps all the queued in-memory writes to a packfile.\n\nIt is the caller's responsibility to ensure that the generated packfile is available to the repository (e.g. by writing it to disk, or doing something crazy like distributing it across several copies of the repository over a network).\n\nOnce the generated packfile is available to the repository, call Mempack.Reset to cleanup the memory store.\n\nCalling Mempack.Reset before the packfile has been written to disk will result in an inconsistent repository (the objects in the memory store won't be accessible).\n\n```go\nfunc (mempack *Mempack) Reset()\n```\nReset resets the memory packer by clearing all the queued objects.\n\nThis assumes that Mempack.Dump has been called before to store all the queued objects into a single packfile.\n\n```go\ntype MergeAnalysis int\n```\n\n```go\nconst (\n\tMergeAnalysisNone        MergeAnalysis = C.GIT_MERGE_ANALYSIS_NONE\n\tMergeAnalysisNormal      MergeAnalysis = C.GIT_MERGE_ANALYSIS_NORMAL\n\tMergeAnalysisUpToDate    MergeAnalysis = C.GIT_MERGE_ANALYSIS_UP_TO_DATE\n\tMergeAnalysisFastForward MergeAnalysis = C.GIT_MERGE_ANALYSIS_FASTFORWARD\n\tMergeAnalysisUnborn      MergeAnalysis = C.GIT_MERGE_ANALYSIS_UNBORN\n)\n```\n\n```go\ntype MergeFileFavor int\n```\n\n```go\nconst (\n\tMergeFileFavorNormal MergeFileFavor = C.GIT_MERGE_FILE_FAVOR_NORMAL\n\tMergeFileFavorOurs   MergeFileFavor = C.GIT_MERGE_FILE_FAVOR_OURS\n\tMergeFileFavorTheirs MergeFileFavor = C.GIT_MERGE_FILE_FAVOR_THEIRS\n\tMergeFileFavorUnion  MergeFileFavor = C.GIT_MERGE_FILE_FAVOR_UNION\n)\n```\n\n```go\ntype MergeFileFlags int\n```\n\n```go\nconst (\n\tMergeFileDefault MergeFileFlags = C.GIT_MERGE_FILE_DEFAULT\n\n\t// Create standard conflicted merge files\n\tMergeFileStyleMerge MergeFileFlags = C.GIT_MERGE_FILE_STYLE_MERGE\n\n\t// Create diff3-style files\n\tMergeFileStyleDiff MergeFileFlags = C.GIT_MERGE_FILE_STYLE_DIFF3\n\n\t// Condense non-alphanumeric regions for simplified diff file\n\tMergeFileStyleSimplifyAlnum MergeFileFlags = C.GIT_MERGE_FILE_SIMPLIFY_ALNUM\n\n\t// Ignore all whitespace\n\tMergeFileIgnoreWhitespace MergeFileFlags = C.GIT_MERGE_FILE_IGNORE_WHITESPACE\n\n\t// Ignore changes in amount of whitespace\n\tMergeFileIgnoreWhitespaceChange MergeFileFlags = C.GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE\n\n\t// Ignore whitespace at end of line\n\tMergeFileIgnoreWhitespaceEOL MergeFileFlags = C.GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL\n\n\t// Use the \"patience diff\" algorithm\n\tMergeFileDiffPatience MergeFileFlags = C.GIT_MERGE_FILE_DIFF_PATIENCE\n\n\t// Take extra time to find minimal diff\n\tMergeFileDiffMinimal MergeFileFlags = C.GIT_MERGE_FILE_DIFF_MINIMAL\n)\n```\n\n```go\ntype MergeFileInput struct {\n\tPath     string\n\tMode     uint\n\tContents []byte\n}\n```\n\n```go\ntype MergeFileOptions struct {\n\tAncestorLabel string\n\tOurLabel      string\n\tTheirLabel    string\n\tFavor         MergeFileFavor\n\tFlags         MergeFileFlags\n\tMarkerSize    uint16\n}\n```\n\n```go\ntype MergeFileResult struct {\n\tAutomergeable bool\n\tPath          string\n\tMode          uint\n\tContents      []byte\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc MergeFile(ancestor MergeFileInput, ours MergeFileInput, theirs MergeFileInput, options *MergeFileOptions) (*MergeFileResult, error)\n```\n\n```go\nfunc (r *MergeFileResult) Free()\n```\n\n```go\ntype MergeOptions struct {\n\tVersion   uint\n\tTreeFlags MergeTreeFlag\n\n\tRenameThreshold uint\n\tTargetLimit     uint\n\tRecursionLimit  uint\n\tFileFavor       MergeFileFavor\n}\n```\n\n```go\nfunc DefaultMergeOptions() (MergeOptions, error)\n```\n\n```go\ntype MergePreference int\n```\n\n```go\nconst (\n\tMergePreferenceNone            MergePreference = C.GIT_MERGE_PREFERENCE_NONE\n\tMergePreferenceNoFastForward   MergePreference = C.GIT_MERGE_PREFERENCE_NO_FASTFORWARD\n\tMergePreferenceFastForwardOnly MergePreference = C.GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY\n)\n```\n\n```go\ntype MergeTreeFlag int\n```\n\n```go\nconst (\n\t// Detect renames that occur between the common ancestor and the \"ours\"\n\t// side or the common ancestor and the \"theirs\" side.  This will enable\n\t// the ability to merge between a modified and renamed file.\n\tMergeTreeFindRenames MergeTreeFlag = C.GIT_MERGE_FIND_RENAMES\n\t// If a conflict occurs, exit immediately instead of attempting to\n\t// continue resolving conflicts.  The merge operation will fail with\n\t// GIT_EMERGECONFLICT and no index will be returned.\n\tMergeTreeFailOnConflict MergeTreeFlag = C.GIT_MERGE_FAIL_ON_CONFLICT\n\t// MergeTreeSkipREUC specifies not to write the REUC extension on the\n\t// generated index.\n\tMergeTreeSkipREUC MergeTreeFlag = C.GIT_MERGE_SKIP_REUC\n\t// MergeTreeNoRecursive specifies not to build a recursive merge base (by\n\t// merging the multiple merge bases) if the commits being merged have\n\t// multiple merge bases. Instead, the first base is used.\n\t// This flag provides a similar merge base to `git-merge-resolve`.\n\tMergeTreeNoRecursive MergeTreeFlag = C.GIT_MERGE_NO_RECURSIVE\n)\n```\n\n```go\ntype MessageEncoding string\n```\nMessageEncoding is the encoding of commit messages.\n\n```go\nconst (\n\t// MessageEncodingUTF8 is the default message encoding.\n\tMessageEncodingUTF8 MessageEncoding = \"UTF-8\"\n)\n```\n\n```go\ntype Note struct {\n\t// contains filtered or unexported fields\n}\n```\nNote\n\n```go\nfunc (n *Note) Author() *Signature\n```\nAuthor returns the signature of the note author\n\n```go\nfunc (n *Note) Committer() *Signature\n```\nCommitter returns the signature of the note committer\n\n```go\nfunc (n *Note) Free() error\n```\nFree frees a git\\_note object\n\n```go\nfunc (n *Note) Id() *Oid\n```\nId returns the note object's id\n\n```go\nfunc (n *Note) Message() string\n```\nMessage returns the note message\n\n```go\ntype NoteCollection struct {\n\t// contains filtered or unexported fields\n}\n```\nThis object represents the possible operations which can be performed on the collection of notes for a repository.\n\n```go\nfunc (c *NoteCollection) Create(\n\tref string, author, committer *Signature, id *Oid,\n\tnote string, force bool) (*Oid, error)\n```\nCreate adds a note for an object\n\n```go\nfunc (c *NoteCollection) DefaultRef() (string, error)\n```\nDefaultRef returns the default notes reference for a repository\n\n```go\nfunc (c *NoteCollection) Read(ref string, id *Oid) (*Note, error)\n```\nRead reads the note for an object\n\n```go\nfunc (c *NoteCollection) Remove(ref string, author, committer *Signature, id *Oid) error\n```\nRemove removes the note for an object\n\n```go\ntype NoteIterator struct {\n\t// contains filtered or unexported fields\n}\n```\nNoteIterator\n\n```go\nfunc (v *NoteIterator) Free()\n```\nFree frees the note interator\n\n```go\nfunc (it *NoteIterator) Next() (noteId, annotatedId *Oid, err error)\n```\nNext returns the current item (note id \u0026 annotated id) and advances the iterator internally to the next item\n\n```go\ntype Object struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (o *Object) AsBlob() (*Blob, error)\n```\n\n```go\nfunc (o *Object) AsCommit() (*Commit, error)\n```\n\n```go\nfunc (o *Object) AsTag() (*Tag, error)\n```\n\n```go\nfunc (o *Object) AsTree() (*Tree, error)\n```\n\n```go\nfunc (o *Object) Free()\n```\n\n```go\nfunc (o *Object) Id() *Oid\n```\n\n```go\nfunc (o *Object) Owner() *Repository\n```\nOwner returns a weak reference to the repository which owns this object. This won't keep the underlying repository alive, but it should still be Freed.\n\n```go\nfunc (o *Object) Peel(t ObjectType) (*Object, error)\n```\nPeel recursively peels an object until an object of the specified type is met.\n\nIf the query cannot be satisfied due to the object model, ErrorCodeInvalidSpec will be returned (e.g. trying to peel a blob to a tree).\n\nIf you pass ObjectAny as the target type, then the object will be peeled until the type changes. A tag will be peeled until the referenced object is no longer a tag, and a commit will be peeled to a tree. Any other object type will return ErrorCodeInvalidSpec.\n\nIf peeling a tag we discover an object which cannot be peeled to the target type due to the object model, an error will be returned.\n\n```go\nfunc (o *Object) ShortId() (string, error)\n```\n\n```go\nfunc (o *Object) Type() ObjectType\n```\n\n```go\ntype ObjectType int\n```\n\n```go\nconst (\n\tObjectAny     ObjectType = C.GIT_OBJECT_ANY\n\tObjectInvalid ObjectType = C.GIT_OBJECT_INVALID\n\tObjectCommit  ObjectType = C.GIT_OBJECT_COMMIT\n\tObjectTree    ObjectType = C.GIT_OBJECT_TREE\n\tObjectBlob    ObjectType = C.GIT_OBJECT_BLOB\n\tObjectTag     ObjectType = C.GIT_OBJECT_TAG\n)\n```\n\n```go\nfunc (t ObjectType) String() string\n```\n\n```go\ntype Objecter interface {\n\tAsObject() *Object\n}\n```\nObjecter lets us accept any kind of Git object in functions.\n\n```go\ntype Odb struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewOdb() (odb *Odb, err error)\n```\n\n```go\nfunc (v *Odb) AddAlternate(backend *OdbBackend, priority int) (err error)\n```\n\n```go\nfunc (v *Odb) AddBackend(backend *OdbBackend, priority int) (err error)\n```\n\n```go\nfunc (v *Odb) Exists(oid *Oid) bool\n```\n\n```go\nfunc (v *Odb) ForEach(callback OdbForEachCallback) error\n```\n\n```go\nfunc (v *Odb) Free()\n```\n\n```go\nfunc (v *Odb) Hash(data []byte, otype ObjectType) (oid *Oid, err error)\n```\nHash determines the object-ID (sha1) of a data buffer.\n\n```go\nfunc (v *Odb) NewReadStream(id *Oid) (*OdbReadStream, error)\n```\nNewReadStream opens a read stream from the ODB. Reading from it will give you the contents of the object.\n\n```go\nfunc (v *Odb) NewWritePack(callback TransferProgressCallback) (*OdbWritepack, error)\n```\nNewWritePack opens a stream for writing a pack file to the ODB. If the ODB layer understands pack files, then the given packfile will likely be streamed directly to disk (and a corresponding index created). If the ODB layer does not understand pack files, the objects will be stored in whatever format the ODB layer uses.\n\n```go\nfunc (v *Odb) NewWriteStream(size int64, otype ObjectType) (*OdbWriteStream, error)\n```\nNewWriteStream opens a write stream to the ODB, which allows you to create a new object in the database. The size and type must be known in advance\n\n```go\nfunc (v *Odb) Read(oid *Oid) (obj *OdbObject, err error)\n```\n\n```go\nfunc (v *Odb) ReadHeader(oid *Oid) (uint64, ObjectType, error)\n```\n\n```go\nfunc (v *Odb) Write(data []byte, otype ObjectType) (oid *Oid, err error)\n```\n\n```go\ntype OdbBackend struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewOdbBackendFromC(ptr unsafe.Pointer) (backend *OdbBackend)\n```\n\n```go\nfunc NewOdbBackendLoose(objectsDir string, compressionLevel int, doFsync bool, dirMode os.FileMode, fileMode os.FileMode) (backend *OdbBackend, err error)\n```\nNewOdbBackendLoose creates a backend for loose objects.\n\n```go\nfunc NewOdbBackendOnePack(packfileIndexPath string) (backend *OdbBackend, err error)\n```\n\n```go\nfunc (v *OdbBackend) Free()\n```\n\n```go\ntype OdbForEachCallback func(id *Oid) error\n```\n\n```go\ntype OdbObject struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (object *OdbObject) Data() (data []byte)\n```\nData returns a slice pointing to the unmanaged object memory. You must make sure the object is referenced for at least as long as the slice is used.\n\n```go\nfunc (v *OdbObject) Free()\n```\n\n```go\nfunc (object *OdbObject) Id() (oid *Oid)\n```\n\n```go\nfunc (object *OdbObject) Len() (len uint64)\n```\n\n```go\nfunc (object *OdbObject) Type() ObjectType\n```\n\n```go\ntype OdbReadStream struct {\n\tSize uint64\n\tType ObjectType\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (stream *OdbReadStream) Close() error\n```\nClose is a dummy function in order to implement the Closer and ReadCloser interfaces\n\n```go\nfunc (stream *OdbReadStream) Free()\n```\n\n```go\nfunc (stream *OdbReadStream) Read(data []byte) (int, error)\n```\nRead reads from the stream\n\n```go\ntype OdbWriteStream struct {\n\tId Oid\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (stream *OdbWriteStream) Close() error\n```\nClose signals that all the data has been written and stores the resulting object id in the stream's Id field.\n\n```go\nfunc (stream *OdbWriteStream) Free()\n```\n\n```go\nfunc (stream *OdbWriteStream) Write(data []byte) (int, error)\n```\nWrite writes to the stream\n\n```go\ntype OdbWritepack struct {\n\t// contains filtered or unexported fields\n}\n```\nOdbWritepack is a stream to write a packfile to the ODB.\n\n```go\nfunc (writepack *OdbWritepack) Commit() error\n```\n\n```go\nfunc (writepack *OdbWritepack) Free()\n```\n\n```go\nfunc (writepack *OdbWritepack) Write(data []byte) (int, error)\n```\n\n```go\ntype Oid [20]byte\n```\nOid represents the id for a Git object.\n\n```go\nfunc NewOid(s string) (*Oid, error)\n```\n\n```go\nfunc NewOidFromBytes(b []byte) *Oid\n```\n\n```go\nfunc (oid *Oid) Cmp(oid2 *Oid) int\n```\n\n```go\nfunc (oid *Oid) Copy() *Oid\n```\n\n```go\nfunc (oid *Oid) Equal(oid2 *Oid) bool\n```\n\n```go\nfunc (oid *Oid) IsZero() bool\n```\n\n```go\nfunc (oid *Oid) NCmp(oid2 *Oid, n uint) int\n```\n\n```go\nfunc (oid *Oid) String() string\n```\n\n```go\ntype Packbuilder struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (pb *Packbuilder) ForEach(callback PackbuilderForeachCallback) error\n```\nForEach repeatedly calls the callback with new packfile data until there is no more data or the callback returns an error\n\n```go\nfunc (pb *Packbuilder) Free()\n```\n\n```go\nfunc (pb *Packbuilder) Insert(id *Oid, name string) error\n```\n\n```go\nfunc (pb *Packbuilder) InsertCommit(id *Oid) error\n```\n\n```go\nfunc (pb *Packbuilder) InsertTree(id *Oid) error\n```\n\n```go\nfunc (pb *Packbuilder) InsertWalk(walk *RevWalk) error\n```\n\n```go\nfunc (pb *Packbuilder) ObjectCount() uint32\n```\n\n```go\nfunc (pb *Packbuilder) Write(w io.Writer) error\n```\n\n```go\nfunc (pb *Packbuilder) WriteToFile(name string, mode os.FileMode) error\n```\n\n```go\nfunc (pb *Packbuilder) Written() uint32\n```\n\n```go\ntype PackbuilderForeachCallback func([]byte) error\n```\n\n```go\ntype PackbuilderProgressCallback func(stage int32, current, total uint32) ErrorCode\n```\n\n```go\ntype Patch struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (patch *Patch) Free() error\n```\n\n```go\nfunc (patch *Patch) String() (string, error)\n```\n\n```go\ntype ProxyOptions struct {\n\t// The type of proxy to use (or none)\n\tType ProxyType\n\n\t// The proxy's URL\n\tUrl string\n}\n```\n\n```go\ntype ProxyType uint\n```\n\n```go\nconst (\n\t// Do not attempt to connect through a proxy\n\t//\n\t// If built against lbicurl, it itself may attempt to connect\n\t// to a proxy if the environment variables specify it.\n\tProxyTypeNone ProxyType = C.GIT_PROXY_NONE\n\n\t// Try to auto-detect the proxy from the git configuration.\n\tProxyTypeAuto ProxyType = C.GIT_PROXY_AUTO\n\n\t// Connect via the URL given in the options\n\tProxyTypeSpecified ProxyType = C.GIT_PROXY_SPECIFIED\n)\n```\n\n```go\ntype PushOptions struct {\n\t// Callbacks to use for this push operation\n\tRemoteCallbacks RemoteCallbacks\n\n\tPbParallelism uint\n\n\t// Headers are extra headers for the push operation.\n\tHeaders []string\n\n\t// Proxy options to use for this push operation\n\tProxyOptions ProxyOptions\n}\n```\n\n```go\ntype PushTransferProgressCallback func(current, total uint32, bytes uint) ErrorCode\n```\n\n```go\ntype PushUpdateReferenceCallback func(refname, status string) ErrorCode\n```\n\n```go\ntype Rebase struct {\n\t// contains filtered or unexported fields\n}\n```\nRebase is the struct representing a Rebase object.\n\n```go\nfunc (rebase *Rebase) Abort() error\n```\nAbort aborts a rebase that is currently in progress, resetting the repository and working directory to their state before rebase began.\n\n```go\nfunc (rebase *Rebase) Commit(ID *Oid, author, committer *Signature, message string) error\n```\nCommit commits the current patch. You must have resolved any conflicts that were introduced during the patch application from the Next() invocation.\n\n```go\nfunc (rebase *Rebase) CurrentOperationIndex() (uint, error)\n```\nCurrentOperationIndex gets the index of the rebase operation that is currently being applied. There is also an error returned for API compatibility.\n\n```go\nfunc (rebase *Rebase) Finish() error\n```\nFinish finishes a rebase that is currently in progress once all patches have been applied.\n\n```go\nfunc (r *Rebase) Free()\n```\nFree frees the Rebase object.\n\n```go\nfunc (rebase *Rebase) InmemoryIndex() (*Index, error)\n```\nInmemoryIndex gets the index produced by the last operation, which is the result of \\`Next()\\` and which will be committed by the next invocation of \\`Commit()\\`. This is useful for resolving conflicts in an in-memory rebase before committing them.\n\nThis is only applicable for in-memory rebases; for rebases within a working directory, the changes were applied to the repository's index.\n\n```go\nfunc (rebase *Rebase) Next() (*RebaseOperation, error)\n```\nNext performs the next rebase operation and returns the information about it. If the operation is one that applies a patch (which is any operation except RebaseOperationExec) then the patch will be applied and the index and working directory will be updated with the changes. If there are conflicts, you will need to address those before committing the changes.\n\n```go\nfunc (rebase *Rebase) OperationAt(index uint) *RebaseOperation\n```\nOperationAt gets the rebase operation specified by the given index.\n\n```go\nfunc (rebase *Rebase) OperationCount() uint\n```\nOperationCount gets the count of rebase operations that are to be applied.\n\n```go\ntype RebaseOperation struct {\n\tType RebaseOperationType\n\tId   *Oid\n\tExec string\n}\n```\nRebaseOperation describes a single instruction/operation to be performed during the rebase.\n\n```go\ntype RebaseOperationType uint\n```\nRebaseOperationType is the type of rebase operation\n\n```go\nconst (\n\t// RebaseOperationPick The given commit is to be cherry-picked.  The client should commit the changes and continue if there are no conflicts.\n\tRebaseOperationPick RebaseOperationType = C.GIT_REBASE_OPERATION_PICK\n\t// RebaseOperationReword The given commit is to be cherry-picked, but the client should prompt the user to provide an updated commit message.\n\tRebaseOperationReword RebaseOperationType = C.GIT_REBASE_OPERATION_REWORD\n\t// RebaseOperationEdit The given commit is to be cherry-picked, but the client should stop to allow the user to edit the changes before committing them.\n\tRebaseOperationEdit RebaseOperationType = C.GIT_REBASE_OPERATION_EDIT\n\t// RebaseOperationSquash The given commit is to be squashed into the previous commit.  The commit message will be merged with the previous message.\n\tRebaseOperationSquash RebaseOperationType = C.GIT_REBASE_OPERATION_SQUASH\n\t// RebaseOperationFixup No commit will be cherry-picked.  The client should run the given command and (if successful) continue.\n\tRebaseOperationFixup RebaseOperationType = C.GIT_REBASE_OPERATION_FIXUP\n\t// RebaseOperationExec No commit will be cherry-picked.  The client should run the given command and (if successful) continue.\n\tRebaseOperationExec RebaseOperationType = C.GIT_REBASE_OPERATION_EXEC\n)\n```\n\n```go\nfunc (t RebaseOperationType) String() string\n```\n\n```go\ntype RebaseOptions struct {\n\tVersion         uint\n\tQuiet           int\n\tInMemory        int\n\tRewriteNotesRef string\n\tMergeOptions    MergeOptions\n\tCheckoutOptions CheckoutOptions\n}\n```\nRebaseOptions are used to tell the rebase machinery how to operate\n\n```go\nfunc DefaultRebaseOptions() (RebaseOptions, error)\n```\nDefaultRebaseOptions returns a RebaseOptions with default values.\n\n```go\ntype Refdb struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (v *Refdb) Free()\n```\n\n```go\nfunc (v *Refdb) SetBackend(backend *RefdbBackend) (err error)\n```\n\n```go\ntype RefdbBackend struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewRefdbBackendFromC(ptr unsafe.Pointer) (backend *RefdbBackend)\n```\n\n```go\nfunc (v *RefdbBackend) Free()\n```\n\n```go\ntype Reference struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r *Reference) Branch() *Branch\n```\n\n```go\nfunc (v *Reference) Cmp(ref2 *Reference) int\n```\nCmp compares v to ref2. It returns 0 on equality, otherwise a stable sorting.\n\n```go\nfunc (v *Reference) Delete() error\n```\n\n```go\nfunc (v *Reference) Free()\n```\n\n```go\nfunc (v *Reference) IsBranch() bool\n```\n\n```go\nfunc (v *Reference) IsNote() bool\n```\nIsNote checks if the reference is a note.\n\n```go\nfunc (v *Reference) IsRemote() bool\n```\n\n```go\nfunc (v *Reference) IsTag() bool\n```\n\n```go\nfunc (v *Reference) Name() string\n```\nName returns the full name of v.\n\n```go\nfunc (v *Reference) Owner() *Repository\n```\nOwner returns a weak reference to the repository which owns this reference. This won't keep the underlying repository alive, but it should still be Freed.\n\n```go\nfunc (v *Reference) Peel(t ObjectType) (*Object, error)\n```\n\n```go\nfunc (v *Reference) Rename(name string, force bool, msg string) (*Reference, error)\n```\n\n```go\nfunc (v *Reference) Resolve() (*Reference, error)\n```\n\n```go\nfunc (v *Reference) SetSymbolicTarget(target string, msg string) (*Reference, error)\n```\n\n```go\nfunc (v *Reference) SetTarget(target *Oid, msg string) (*Reference, error)\n```\n\n```go\nfunc (v *Reference) Shorthand() string\n```\nShorthand returns a \"human-readable\" short reference name.\n\n```go\nfunc (v *Reference) SymbolicTarget() string\n```\n\n```go\nfunc (v *Reference) Target() *Oid\n```\n\n```go\nfunc (v *Reference) Type() ReferenceType\n```\n\n```go\ntype ReferenceCollection struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *ReferenceCollection) Create(name string, id *Oid, force bool, msg string) (*Reference, error)\n```\n\n```go\nfunc (c *ReferenceCollection) CreateSymbolic(name, target string, force bool, msg string) (*Reference, error)\n```\n\n```go\nfunc (c *ReferenceCollection) Dwim(name string) (*Reference, error)\n```\nDwim looks up a reference by DWIMing its short name\n\n```go\nfunc (c *ReferenceCollection) EnsureLog(name string) error\n```\nEnsureLog ensures that there is a reflog for the given reference name and creates an empty one if necessary.\n\n```go\nfunc (c *ReferenceCollection) HasLog(name string) (bool, error)\n```\nHasLog returns whether there is a reflog for the given reference name\n\n```go\nfunc (c *ReferenceCollection) Lookup(name string) (*Reference, error)\n```\n\n```go\ntype ReferenceFormat uint\n```\n\n```go\nconst (\n\tReferenceFormatNormal           ReferenceFormat = C.GIT_REFERENCE_FORMAT_NORMAL\n\tReferenceFormatAllowOnelevel    ReferenceFormat = C.GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL\n\tReferenceFormatRefspecPattern   ReferenceFormat = C.GIT_REFERENCE_FORMAT_REFSPEC_PATTERN\n\tReferenceFormatRefspecShorthand ReferenceFormat = C.GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND\n)\n```\n\n```go\ntype ReferenceIterator struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (v *ReferenceIterator) Free()\n```\nFree the reference iterator\n\n```go\nfunc (i *ReferenceIterator) Names() *ReferenceNameIterator\n```\n\n```go\nfunc (v *ReferenceIterator) Next() (*Reference, error)\n```\nNext retrieves the next reference. If the iterationis over, the returned error code is git.ErrorCodeIterOver\n\n```go\ntype ReferenceNameIterator struct {\n\t*ReferenceIterator\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (v *ReferenceNameIterator) Next() (string, error)\n```\nNextName retrieves the next reference name. If the iteration is over, the returned error code is git.ErrorCodeIterOver\n\n```go\ntype ReferenceType int\n```\n\n```go\nconst (\n\tReferenceSymbolic ReferenceType = C.GIT_REF_SYMBOLIC\n\tReferenceOid      ReferenceType = C.GIT_REF_OID\n)\n```\n\n```go\ntype Refspec struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc ParseRefspec(input string, isFetch bool) (*Refspec, error)\n```\nParseRefspec parses a given refspec string\n\n```go\nfunc (s *Refspec) Direction() ConnectDirection\n```\nDirection returns the refspec's direction\n\n```go\nfunc (s *Refspec) Dst() string\n```\nDst returns the refspec's destination specifier\n\n```go\nfunc (s *Refspec) DstMatches(refname string) bool\n```\nSrcMatches checks if a refspec's destination descriptor matches a reference\n\n```go\nfunc (s *Refspec) Force() bool\n```\nForce returns the refspec's force-update setting\n\n```go\nfunc (s *Refspec) Free()\n```\nFree releases a refspec object which has been created by ParseRefspec\n\n```go\nfunc (s *Refspec) Rtransform(refname string) (string, error)\n```\nRtransform converts a target reference to its source reference following the refspec's rules\n\n```go\nfunc (s *Refspec) Src() string\n```\nSrc returns the refspec's source specifier\n\n```go\nfunc (s *Refspec) SrcMatches(refname string) bool\n```\nSrcMatches checks if a refspec's source descriptor matches a reference\n\n```go\nfunc (s *Refspec) String() string\n```\nString returns the refspec's string representation\n\n```go\nfunc (s *Refspec) Transform(refname string) (string, error)\n```\nTransform a reference to its target following the refspec's rules\n\n```go\ntype RegisteredSmartTransport struct {\n\t// contains filtered or unexported fields\n}\n```\nRegisteredSmartTransport represents a transport that has been registered.\n\n```go\nfunc NewRegisteredSmartTransport(\n\tname string,\n\tstateless bool,\n\tcallback SmartSubtransportCallback,\n) (*RegisteredSmartTransport, error)\n```\nNewRegisteredSmartTransport adds a custom transport definition, to be used in addition to the built-in set of transports that come with libgit2.\n\n```go\nfunc RegisterManagedHTTPTransport(protocol string) (*RegisteredSmartTransport, error)\n```\nRegisterManagedHTTPTransport registers a Go-native implementation of an HTTP/S transport that doesn't rely on any system libraries (e.g. libopenssl/libmbedtls).\n\nIf Shutdown or ReInit are called, make sure that the smart transports are freed before it.\n\n```go\nfunc RegisterManagedSSHTransport(protocol string) (*RegisteredSmartTransport, error)\n```\nRegisterManagedSSHTransport registers a Go-native implementation of an SSH transport that doesn't rely on any system libraries (e.g. libssh2).\n\nIf Shutdown or ReInit are called, make sure that the smart transports are freed before it.\n\n```go\nfunc (t *RegisteredSmartTransport) Free() error\n```\nFree releases all resources used by the RegisteredSmartTransport and unregisters the custom transport definition referenced by it.\n\n```go\ntype Remote struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (o *Remote) Connect(direction ConnectDirection, callbacks *RemoteCallbacks, proxyOpts *ProxyOptions, headers []string) error\n```\nConnect opens a connection to a remote.\n\nThe transport is selected based on the URL. The direction argument is due to a limitation of the git protocol (over TCP or SSH) which starts up a specific binary which can only do the one or the other.\n\n'headers' are extra HTTP headers to use in this connection.\n\n```go\nfunc (o *Remote) ConnectFetch(callbacks *RemoteCallbacks, proxyOpts *ProxyOptions, headers []string) error\n```\n\n```go\nfunc (o *Remote) ConnectPush(callbacks *RemoteCallbacks, proxyOpts *ProxyOptions, headers []string) error\n```\n\n```go\nfunc (o *Remote) Disconnect()\n```\n\n```go\nfunc (o *Remote) Fetch(refspecs []string, opts *FetchOptions, msg string) error\n```\nFetch performs a fetch operation. refspecs specifies which refspecs to use for this fetch, use an empty list to use the refspecs from the configuration; msg specifies what to use for the reflog entries. Leave \"\" to use defaults.\n\n```go\nfunc (o *Remote) FetchRefspecs() ([]string, error)\n```\n\n```go\nfunc (r *Remote) Free()\n```\nFree releases the resources of the Remote.\n\n```go\nfunc (o *Remote) Ls(filterRefs ...string) ([]RemoteHead, error)\n```\n\n```go\nfunc (o *Remote) Name() string\n```\n\n```go\nfunc (o *Remote) Prune(callbacks *RemoteCallbacks) error\n```\n\n```go\nfunc (o *Remote) PruneRefs() bool\n```\n\n```go\nfunc (o *Remote) Push(refspecs []string, opts *PushOptions) error\n```\n\n```go\nfunc (o *Remote) PushRefspecs() ([]string, error)\n```\n\n```go\nfunc (o *Remote) PushUrl() string\n```\n\n```go\nfunc (o *Remote) RefspecCount() uint\n```\n\n```go\nfunc (o *Remote) Url() string\n```\n\n```go\ntype RemoteCallbacks struct {\n\tSidebandProgressCallback TransportMessageCallback\n\tCompletionCallback\n\tCredentialsCallback\n\tTransferProgressCallback\n\tUpdateTipsCallback\n\tCertificateCheckCallback\n\tPackProgressCallback PackbuilderProgressCallback\n\tPushTransferProgressCallback\n\tPushUpdateReferenceCallback\n}\n```\n\n```go\ntype RemoteCollection struct {\n\tsync.RWMutex\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *RemoteCollection) AddFetch(remote, refspec string) error\n```\n\n```go\nfunc (c *RemoteCollection) AddPush(remote, refspec string) error\n```\n\n```go\nfunc (c *RemoteCollection) Create(name string, url string) (*Remote, error)\n```\n\n```go\nfunc (c *RemoteCollection) CreateAnonymous(url string) (*Remote, error)\n```\n\n```go\nfunc (c *RemoteCollection) CreateWithFetchspec(name string, url string, fetch string) (*Remote, error)\n```\n\n```go\nfunc (c *RemoteCollection) CreateWithOptions(url string, option *RemoteCreateOptions) (*Remote, error)\n```\nCreateWithOptions Creates a repository object with extended options.\n\n```go\nfunc (c *RemoteCollection) Delete(name string) error\n```\n\n```go\nfunc (c *RemoteCollection) Free()\n```\n\n```go\nfunc (c *RemoteCollection) List() ([]string, error)\n```\n\n```go\nfunc (c *RemoteCollection) Lookup(name string) (*Remote, error)\n```\n\n```go\nfunc (c *RemoteCollection) Rename(remote, newname string) ([]string, error)\n```\n\n```go\nfunc (c *RemoteCollection) SetPushUrl(remote, url string) error\n```\n\n```go\nfunc (c *RemoteCollection) SetUrl(remote, url string) error\n```\n\n```go\ntype RemoteCompletion uint\n```\n\n```go\ntype RemoteCreateCallback func(repo *Repository, name, url string) (*Remote, ErrorCode)\n```\n\n```go\ntype RemoteCreateOptions struct {\n\tName      string\n\tFetchSpec string\n\tFlags     RemoteCreateOptionsFlag\n}\n```\nRemoteCreateOptions contains options for creating a remote\n\n```go\nfunc DefaultRemoteCreateOptions() (*RemoteCreateOptions, error)\n```\nDefaultApplyOptions returns default options for remote create\n\n```go\ntype RemoteCreateOptionsFlag uint\n```\nRemoteCreateOptionsFlag is Remote creation options flags\n\n```go\nconst (\n\t// Ignore the repository apply.insteadOf configuration\n\tRemoteCreateSkipInsteadof RemoteCreateOptionsFlag = C.GIT_REMOTE_CREATE_SKIP_INSTEADOF\n\t// Don't build a fetchspec from the name if none is set\n\tRemoteCreateSkipDefaultFetchspec RemoteCreateOptionsFlag = C.GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC\n)\n```\n\n```go\ntype RemoteHead struct {\n\tId   *Oid\n\tName string\n}\n```\n\n```go\ntype Repository struct {\n\n\t// Remotes represents the collection of remotes and can be\n\t// used to add, remove and configure remotes for this\n\t// repository.\n\tRemotes RemoteCollection\n\t// Submodules represents the collection of submodules and can\n\t// be used to add, remove and configure submodules in this\n\t// repository.\n\tSubmodules SubmoduleCollection\n\t// References represents the collection of references and can\n\t// be used to create, remove or update references for this repository.\n\tReferences ReferenceCollection\n\t// Notes represents the collection of notes and can be used to\n\t// read, write and delete notes from this repository.\n\tNotes NoteCollection\n\t// Tags represents the collection of tags and can be used to create,\n\t// list, iterate and remove tags in this repository.\n\tTags TagsCollection\n\t// Stashes represents the collection of stashes and can be used to\n\t// save, apply and iterate over stash states in this repository.\n\tStashes StashCollection\n\t// contains filtered or unexported fields\n}\n```\nRepository\n\n```go\nfunc Clone(url string, path string, options *CloneOptions) (*Repository, error)\n```\n\n```go\nfunc InitRepository(path string, isbare bool) (*Repository, error)\n```\n\n```go\nfunc NewRepositoryWrapOdb(odb *Odb) (repo *Repository, err error)\n```\n\n```go\nfunc OpenRepository(path string) (*Repository, error)\n```\n\n```go\nfunc OpenRepositoryExtended(path string, flags RepositoryOpenFlag, ceiling string) (*Repository, error)\n```\n\n```go\nfunc (r *Repository) AddGitIgnoreRules(rules string) error\n```\n\n```go\nfunc (v *Repository) AddIgnoreRule(rules string) error\n```\n\n```go\nfunc (repo *Repository) AheadBehind(local, upstream *Oid) (ahead, behind int, err error)\n```\n\n```go\nfunc (r *Repository) AnnotatedCommitFromFetchHead(branchName string, remoteURL string, oid *Oid) (*AnnotatedCommit, error)\n```\n\n```go\nfunc (r *Repository) AnnotatedCommitFromRef(ref *Reference) (*AnnotatedCommit, error)\n```\n\n```go\nfunc (r *Repository) AnnotatedCommitFromRevspec(spec string) (*AnnotatedCommit, error)\n```\n\n```go\nfunc (v *Repository) ApplyDiff(diff *Diff, location ApplyLocation, opts *ApplyOptions) error\n```\nApplyDiff appllies a Diff to the given repository, making changes directly in the working directory, the index, or both.\n\n```go\nfunc (v *Repository) ApplyToTree(diff *Diff, tree *Tree, opts *ApplyOptions) (*Index, error)\n```\nApplyToTree applies a Diff to a Tree and returns the resulting image as an Index.\n\n```go\nfunc (v *Repository) BlameFile(path string, opts *BlameOptions) (*Blame, error)\n```\n\n```go\nfunc (v *Repository) CheckoutHead(opts *CheckoutOptions) error\n```\nUpdates files in the index and the working tree to match the content of the commit pointed at by HEAD. opts may be nil.\n\n```go\nfunc (v *Repository) CheckoutIndex(index *Index, opts *CheckoutOptions) error\n```\nUpdates files in the working tree to match the content of the given index. If index is nil, the repository's index will be used. opts may be nil.\n\n```go\nfunc (v *Repository) CheckoutTree(tree *Tree, opts *CheckoutOptions) error\n```\n\n```go\nfunc (v *Repository) Cherrypick(commit *Commit, opts CherrypickOptions) error\n```\n\n```go\nfunc (r *Repository) CherrypickCommit(pick, our *Commit, opts CherrypickOptions) (*Index, error)\n```\n\n```go\nfunc (r *Repository) ClearGitIgnoreRules() error\n```\n\n```go\nfunc (v *Repository) ClearInternalIgnoreRules() error\n```\n\n```go\nfunc (v *Repository) Config() (*Config, error)\n```\n\n```go\nfunc (repo *Repository) CreateBlobFromBuffer(data []byte) (*Oid, error)\n```\n\n```go\nfunc (repo *Repository) CreateBranch(branchName string, target *Commit, force bool) (*Branch, error)\n```\n\n```go\nfunc (v *Repository) CreateCommit(\n\trefname string, author, committer *Signature,\n\tmessage string, tree *Tree, parents ...*Commit) (*Oid, error)\n```\n\n```go\nfunc (v *Repository) CreateCommitBuffer(\n\tauthor, committer *Signature,\n\tmessageEncoding MessageEncoding,\n\tmessage string,\n\ttree *Tree,\n\tparents ...*Commit,\n) ([]byte, error)\n```\nCreateCommitBuffer creates a commit and write it into a buffer.\n\n```go\nfunc (v *Repository) CreateCommitFromIds(\n\trefname string, author, committer *Signature,\n\tmessage string, tree *Oid, parents ...*Oid) (*Oid, error)\n```\n\n```go\nfunc (v *Repository) CreateCommitWithSignature(\n\tcommitContent, signature, signatureField string,\n) (*Oid, error)\n```\nCreateCommitWithSignature creates a commit object from the given contents and signature.\n\n```go\nfunc (repo *Repository) CreateFromStream(hintPath string) (*BlobWriteStream, error)\n```\n\n```go\nfunc (repo *Repository) DefaultSignature() (*Signature, error)\n```\n\n```go\nfunc (repo *Repository) DescendantOf(commit, ancestor *Oid) (bool, error)\n```\n\n```go\nfunc (repo *Repository) DescribeWorkdir(opts *DescribeOptions) (*DescribeResult, error)\n```\nDescribeWorkdir describes the working tree. It means describe HEAD and appends \\\u003cmark\u003e (-dirty by default) if the working tree is dirty.\n\n```go\nfunc (v *Repository) DiffIndexToWorkdir(index *Index, opts *DiffOptions) (*Diff, error)\n```\n\n```go\nfunc (v *Repository) DiffTreeToIndex(oldTree *Tree, index *Index, opts *DiffOptions) (*Diff, error)\n```\n\n```go\nfunc (v *Repository) DiffTreeToTree(oldTree, newTree *Tree, opts *DiffOptions) (*Diff, error)\n```\n\n```go\nfunc (v *Repository) DiffTreeToWorkdir(oldTree *Tree, opts *DiffOptions) (*Diff, error)\n```\n\n```go\nfunc (v *Repository) DiffTreeToWorkdirWithIndex(oldTree *Tree, opts *DiffOptions) (*Diff, error)\n```\n\n```go\nfunc (v *Repository) Free()\n```\n\n```go\nfunc (v *Repository) Head() (*Reference, error)\n```\n\n```go\nfunc (v *Repository) Index() (*Index, error)\n```\n\n```go\nfunc (r *Repository) InitRebase(branch *AnnotatedCommit, upstream *AnnotatedCommit, onto *AnnotatedCommit, opts *RebaseOptions) (*Rebase, error)\n```\nInitRebase initializes a rebase operation to rebase the changes in branch relative to upstream onto another branch.\n\n```go\nfunc (repo *Repository) IsBare() bool\n```\n\n```go\nfunc (v *Repository) IsEmpty() (bool, error)\n```\n\n```go\nfunc (v *Repository) IsHeadDetached() (bool, error)\n```\n\n```go\nfunc (v *Repository) IsHeadUnborn() (bool, error)\n```\n\n```go\nfunc (v *Repository) IsPathIgnored(path string) (bool, error)\n```\n\n```go\nfunc (v *Repository) IsShallow() (bool, error)\n```\n\n```go\nfunc (r *Repository) ItemPath(item RepositoryItem) (string, error)\n```\n\n```go\nfunc (v *Repository) Lookup(id *Oid) (*Object, error)\n```\n\n```go\nfunc (r *Repository) LookupAnnotatedCommit(oid *Oid) (*AnnotatedCommit, error)\n```\n\n```go\nfunc (v *Repository) LookupBlob(id *Oid) (*Blob, error)\n```\n\n```go\nfunc (repo *Repository) LookupBranch(branchName string, bt BranchType) (*Branch, error)\n```\n\n```go\nfunc (v *Repository) LookupCommit(id *Oid) (*Commit, error)\n```\n\n```go\nfunc (v *Repository) LookupPrefix(id *Oid, prefix uint) (*Object, error)\n```\nLookupPrefix looks up an object by its OID given a prefix of its identifier.\n\n```go\nfunc (v *Repository) LookupPrefixBlob(id *Oid, prefix uint) (*Blob, error)\n```\nLookupPrefixBlob looks up a blob by its OID given a prefix of its identifier.\n\n```go\nfunc (v *Repository) LookupPrefixCommit(id *Oid, prefix uint) (*Commit, error)\n```\nLookupPrefixCommit looks up a commit by its OID given a prefix of its identifier.\n\n```go\nfunc (v *Repository) LookupPrefixTag(id *Oid, prefix uint) (*Tag, error)\n```\nLookupPrefixTag looks up a tag by its OID given a prefix of its identifier.\n\n```go\nfunc (v *Repository) LookupPrefixTree(id *Oid, prefix uint) (*Tree, error)\n```\nLookupPrefixTree looks up a tree by its OID given a prefix of its identifier.\n\n```go\nfunc (v *Repository) LookupTag(id *Oid) (*Tag, error)\n```\n\n```go\nfunc (v *Repository) LookupTree(id *Oid) (*Tree, error)\n```\n\n```go\nfunc (r *Repository) Merge(theirHeads []*AnnotatedCommit, mergeOptions *MergeOptions, checkoutOptions *CheckoutOptions) error\n```\n\n```go\nfunc (r *Repository) MergeAnalysis(theirHeads []*AnnotatedCommit) (MergeAnalysis, MergePreference, error)\n```\nMergeAnalysis returns the possible actions which could be taken by a 'git-merge' command. There may be multiple answers, so the first return value is a bitmask of MergeAnalysis values.\n\n```go\nfunc (r *Repository) MergeBase(one *Oid, two *Oid) (*Oid, error)\n```\n\n```go\nfunc (r *Repository) MergeBaseMany(oids []*Oid) (*Oid, error)\n```\nMergeBaseMany finds a merge base given a list of commits.\n\n```go\nfunc (r *Repository) MergeBaseOctopus(oids []*Oid) (*Oid, error)\n```\nMergeBaseOctopus finds a merge base in preparation for an octopus merge.\n\n```go\nfunc (r *Repository) MergeBases(one, two *Oid) ([]*Oid, error)\n```\nMergeBases retrieves the list of merge bases between two commits.\n\nIf none are found, an empty slice is returned and the error is set approprately\n\n```go\nfunc (r *Repository) MergeBasesMany(oids []*Oid) ([]*Oid, error)\n```\nMergeBasesMany finds all merge bases given a list of commits.\n\n```go\nfunc (r *Repository) MergeCommits(ours *Commit, theirs *Commit, options *MergeOptions) (*Index, error)\n```\n\n```go\nfunc (r *Repository) MergeTrees(ancestor *Tree, ours *Tree, theirs *Tree, options *MergeOptions) (*Index, error)\n```\n\n```go\nfunc (r *Repository) Message() (string, error)\n```\nMessage retrieves git's prepared message. Operations such as git revert/cherry-pick/merge with the -n option stop just short of creating a commit with the changes and save their prepared message in .git/MERGE\\_MSG so the next git-commit execution can present it to the user for them to amend if they wish.\n\nUse this function to get the contents of this file. Don't forget to remove the file after you create the commit.\n\n```go\nfunc (repo *Repository) NewBranchIterator(flags BranchType) (*BranchIterator, error)\n```\n\n```go\nfunc (repo *Repository) NewNoteIterator(ref string) (*NoteIterator, error)\n```\nNewNoteIterator creates a new iterator for notes\n\n```go\nfunc (repo *Repository) NewPackbuilder() (*Packbuilder, error)\n```\n\n```go\nfunc (v *Repository) NewRefdb() (refdb *Refdb, err error)\n```\n\n```go\nfunc (repo *Repository) NewReferenceIterator() (*ReferenceIterator, error)\n```\nNewReferenceIterator creates a new iterator over reference names\n\n```go\nfunc (repo *Repository) NewReferenceIteratorGlob(glob string) (*ReferenceIterator, error)\n```\nNewReferenceIteratorGlob creates an iterator over reference names that match the speicified glob. The glob is of the usual fnmatch type.\n\n```go\nfunc (repo *Repository) NewReferenceNameIterator() (*ReferenceNameIterator, error)\n```\nNewReferenceIterator creates a new branch iterator over reference names\n\n```go\nfunc (v *Repository) Odb() (odb *Odb, err error)\n```\n\n```go\nfunc (r *Repository) OpenRebase(opts *RebaseOptions) (*Rebase, error)\n```\nOpenRebase opens an existing rebase that was previously started by either an invocation of InitRebase or by another client.\n\n```go\nfunc (v *Repository) PatchFromBuffers(oldPath, newPath string, oldBuf, newBuf []byte, opts *DiffOptions) (*Patch, error)\n```\n\n```go\nfunc (repo *Repository) Path() string\n```\n\n```go\nfunc (repo *Repository) RemoteName(canonicalBranchName string) (string, error)\n```\n\n```go\nfunc (r *Repository) RemoveMessage() error\n```\nRemoveMessage removes git's prepared message.\n\n```go\nfunc (r *Repository) ResetDefaultToCommit(commit *Commit, pathspecs []string) error\n```\n\n```go\nfunc (r *Repository) ResetToCommit(commit *Commit, resetType ResetType, opts *CheckoutOptions) error\n```\n\n```go\nfunc (r *Repository) Revert(commit *Commit, revertOptions *RevertOptions) error\n```\nRevert the provided commit leaving the index updated with the results of the revert\n\n```go\nfunc (r *Repository) RevertCommit(revertCommit *Commit, ourCommit *Commit, mainline uint, mergeOptions *MergeOptions) (*Index, error)\n```\nRevertCommit reverts the provided commit against \"ourCommit\" The returned index contains the result of the revert and should be freed\n\n```go\nfunc (r *Repository) Revparse(spec string) (*Revspec, error)\n```\n\n```go\nfunc (r *Repository) RevparseExt(spec string) (*Object, *Reference, error)\n```\n\n```go\nfunc (v *Repository) RevparseSingle(spec string) (*Object, error)\n```\n\n```go\nfunc (v *Repository) SetConfig(c *Config) error\n```\nSetConfig sets the configuration file for this repository.\n\nThis configuration file will be used for all configuration queries involving this repository.\n\n```go\nfunc (v *Repository) SetHead(refname string) error\n```\n\n```go\nfunc (v *Repository) SetHeadDetached(id *Oid) error\n```\n\n```go\nfunc (v *Repository) SetRefdb(refdb *Refdb)\n```\n\n```go\nfunc (repo *Repository) SetWorkdir(workdir string, updateGitlink bool) error\n```\n\n```go\nfunc (r *Repository) State() RepositoryState\n```\n\n```go\nfunc (r *Repository) StateCleanup() error\n```\n\n```go\nfunc (v *Repository) StatusFile(path string) (Status, error)\n```\n\n```go\nfunc (v *Repository) StatusList(opts *StatusOptions) (*StatusList, error)\n```\n\n```go\nfunc (v *Repository) TreeBuilder() (*TreeBuilder, error)\n```\n\n```go\nfunc (v *Repository) TreeBuilderFromTree(tree *Tree) (*TreeBuilder, error)\n```\n\n```go\nfunc (repo *Repository) UpstreamName(canonicalBranchName string) (string, error)\n```\n\n```go\nfunc (v *Repository) Walk() (*RevWalk, error)\n```\n\n```go\nfunc (repo *Repository) Workdir() string\n```\n\n```go\ntype RepositoryItem int\n```\n\n```go\nconst (\n\tRepositoryItemGitDir     RepositoryItem = C.GIT_REPOSITORY_ITEM_GITDIR\n\tRepositoryItemWorkDir    RepositoryItem = C.GIT_REPOSITORY_ITEM_WORKDIR\n\tRepositoryItemCommonDir  RepositoryItem = C.GIT_REPOSITORY_ITEM_COMMONDIR\n\tRepositoryItemIndex      RepositoryItem = C.GIT_REPOSITORY_ITEM_INDEX\n\tRepositoryItemObjects    RepositoryItem = C.GIT_REPOSITORY_ITEM_OBJECTS\n\tRepositoryItemRefs       RepositoryItem = C.GIT_REPOSITORY_ITEM_REFS\n\tRepositoryItemPackedRefs RepositoryItem = C.GIT_REPOSITORY_ITEM_PACKED_REFS\n\tRepositoryItemRemotes    RepositoryItem = C.GIT_REPOSITORY_ITEM_REMOTES\n\tRepositoryItemConfig     RepositoryItem = C.GIT_REPOSITORY_ITEM_CONFIG\n\tRepositoryItemInfo       RepositoryItem = C.GIT_REPOSITORY_ITEM_INFO\n\tRepositoryItemHooks      RepositoryItem = C.GIT_REPOSITORY_ITEM_HOOKS\n\tRepositoryItemLogs       RepositoryItem = C.GIT_REPOSITORY_ITEM_LOGS\n\tRepositoryItemModules    RepositoryItem = C.GIT_REPOSITORY_ITEM_MODULES\n\tRepositoryItemWorkTrees  RepositoryItem = C.GIT_REPOSITORY_ITEM_WORKTREES\n)\n```\n\n```go\ntype RepositoryOpenFlag int\n```\n\n```go\nconst (\n\tRepositoryOpenNoSearch RepositoryOpenFlag = C.GIT_REPOSITORY_OPEN_NO_SEARCH\n\tRepositoryOpenCrossFs  RepositoryOpenFlag = C.GIT_REPOSITORY_OPEN_CROSS_FS\n\tRepositoryOpenBare     RepositoryOpenFlag = C.GIT_REPOSITORY_OPEN_BARE\n\tRepositoryOpenFromEnv  RepositoryOpenFlag = C.GIT_REPOSITORY_OPEN_FROM_ENV\n\tRepositoryOpenNoDotGit RepositoryOpenFlag = C.GIT_REPOSITORY_OPEN_NO_DOTGIT\n)\n```\n\n```go\ntype RepositoryState int\n```\n\n```go\nconst (\n\tRepositoryStateNone                 RepositoryState = C.GIT_REPOSITORY_STATE_NONE\n\tRepositoryStateMerge                RepositoryState = C.GIT_REPOSITORY_STATE_MERGE\n\tRepositoryStateRevert               RepositoryState = C.GIT_REPOSITORY_STATE_REVERT\n\tRepositoryStateCherrypick           RepositoryState = C.GIT_REPOSITORY_STATE_CHERRYPICK\n\tRepositoryStateBisect               RepositoryState = C.GIT_REPOSITORY_STATE_BISECT\n\tRepositoryStateRebase               RepositoryState = C.GIT_REPOSITORY_STATE_REBASE\n\tRepositoryStateRebaseInteractive    RepositoryState = C.GIT_REPOSITORY_STATE_REBASE_INTERACTIVE\n\tRepositoryStateRebaseMerge          RepositoryState = C.GIT_REPOSITORY_STATE_REBASE_MERGE\n\tRepositoryStateApplyMailbox         RepositoryState = C.GIT_REPOSITORY_STATE_APPLY_MAILBOX\n\tRepositoryStateApplyMailboxOrRebase RepositoryState = C.GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE\n)\n```\n\n```go\ntype ResetType int\n```\n\n```go\nconst (\n\tResetSoft  ResetType = C.GIT_RESET_SOFT\n\tResetMixed ResetType = C.GIT_RESET_MIXED\n\tResetHard  ResetType = C.GIT_RESET_HARD\n)\n```\n\n```go\ntype RevWalk struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (v *RevWalk) Free()\n```\n\n```go\nfunc (v *RevWalk) Hide(id *Oid) error\n```\n\n```go\nfunc (v *RevWalk) HideGlob(glob string) error\n```\n\n```go\nfunc (v *RevWalk) HideHead() (err error)\n```\n\n```go\nfunc (v *RevWalk) HideRef(r string) error\n```\n\n```go\nfunc (v *RevWalk) Iterate(fun RevWalkIterator) (err error)\n```\n\n```go\nfunc (v *RevWalk) Next(id *Oid) (err error)\n```\n\n```go\nfunc (v *RevWalk) Push(id *Oid) error\n```\n\n```go\nfunc (v *RevWalk) PushGlob(glob string) error\n```\n\n```go\nfunc (v *RevWalk) PushHead() (err error)\n```\n\n```go\nfunc (v *RevWalk) PushRange(r string) error\n```\n\n```go\nfunc (v *RevWalk) PushRef(r string) error\n```\n\n```go\nfunc (v *RevWalk) Reset()\n```\n\n```go\nfunc (v *RevWalk) SimplifyFirstParent()\n```\n\n```go\nfunc (v *RevWalk) Sorting(sm SortType)\n```\n\n```go\ntype RevWalkIterator func(commit *Commit) bool\n```\n\n```go\ntype RevertOptions struct {\n\tMainline     uint\n\tMergeOpts    MergeOptions\n\tCheckoutOpts CheckoutOptions\n}\n```\nRevertOptions contains options for performing a revert\n\n```go\nfunc DefaultRevertOptions() (RevertOptions, error)\n```\nDefaultRevertOptions initialises a RevertOptions struct with default values\n\n```go\ntype RevparseFlag int\n```\n\n```go\nconst (\n\tRevparseSingle    RevparseFlag = C.GIT_REVPARSE_SINGLE\n\tRevparseRange     RevparseFlag = C.GIT_REVPARSE_RANGE\n\tRevparseMergeBase RevparseFlag = C.GIT_REVPARSE_MERGE_BASE\n)\n```\n\n```go\ntype Revspec struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (rs *Revspec) Flags() RevparseFlag\n```\n\n```go\nfunc (rs *Revspec) From() *Object\n```\n\n```go\nfunc (rs *Revspec) To() *Object\n```\n\n```go\ntype Signature struct {\n\tName  string\n\tEmail string\n\tWhen  time.Time\n}\n```\n\n```go\nfunc (v *Signature) Offset() int\n```\nOffset returns the time zone offset of v.When in minutes, which is what git wants.\n\n```go\ntype SmartServiceAction int\n```\nSmartServiceAction is an action that the smart transport can ask a subtransport to perform.\n\n```go\nconst (\n\t// SmartServiceActionUploadpackLs is used upon connecting to a remote, and is\n\t// used to perform reference discovery prior to performing a pull operation.\n\tSmartServiceActionUploadpackLs SmartServiceAction = C.GIT_SERVICE_UPLOADPACK_LS\n\n\t// SmartServiceActionUploadpack is used when performing a pull operation.\n\tSmartServiceActionUploadpack SmartServiceAction = C.GIT_SERVICE_UPLOADPACK\n\n\t// SmartServiceActionReceivepackLs is used upon connecting to a remote, and is\n\t// used to perform reference discovery prior to performing a push operation.\n\tSmartServiceActionReceivepackLs SmartServiceAction = C.GIT_SERVICE_RECEIVEPACK_LS\n\n\t// SmartServiceActionReceivepack is used when performing a push operation.\n\tSmartServiceActionReceivepack SmartServiceAction = C.GIT_SERVICE_RECEIVEPACK\n)\n```\n\n```go\ntype SmartSubtransport interface {\n\t// Action creates a SmartSubtransportStream for the provided url and\n\t// requested action.\n\tAction(url string, action SmartServiceAction) (SmartSubtransportStream, error)\n\n\t// Close closes the SmartSubtransport.\n\t//\n\t// Subtransports are guaranteed a call to Close between\n\t// calls to Action, except for the following two \"natural\" progressions\n\t// of actions against a constant URL.\n\t//\n\t// 1. UPLOADPACK_LS -\u003e UPLOADPACK\n\t// 2. RECEIVEPACK_LS -\u003e RECEIVEPACK\n\tClose() error\n\n\t// Free releases the resources of the SmartSubtransport.\n\tFree()\n}\n```\nSmartSubtransport is the interface for custom subtransports which carry data for the smart transport.\n\n```go\ntype SmartSubtransportCallback func(remote *Remote, transport *Transport) (SmartSubtransport, error)\n```\nSmartSubtransportCallback is a function which creates a new subtransport for the smart transport.\n\n```go\ntype SmartSubtransportStream interface {\n\tio.Reader\n\tio.Writer\n\n\t// Free releases the resources of the SmartSubtransportStream.\n\tFree()\n}\n```\nSmartSubtransportStream is the interface for streams used by the smart transport to read and write data from a subtransport.\n\n```go\ntype SortType uint\n```\n\n```go\nconst (\n\tSortNone        SortType = C.GIT_SORT_NONE\n\tSortTopological SortType = C.GIT_SORT_TOPOLOGICAL\n\tSortTime        SortType = C.GIT_SORT_TIME\n\tSortReverse     SortType = C.GIT_SORT_REVERSE\n)\n```\n\n```go\ntype StashApplyFlag int\n```\nStashApplyFlag are flags that affect the stash apply operation.\n\n```go\nconst (\n\t// StashApplyDefault is the default.\n\tStashApplyDefault StashApplyFlag = C.GIT_STASH_APPLY_DEFAULT\n\n\t// StashApplyReinstateIndex will try to reinstate not only the\n\t// working tree's changes, but also the index's changes.\n\tStashApplyReinstateIndex StashApplyFlag = C.GIT_STASH_APPLY_REINSTATE_INDEX\n)\n```\n\n```go\ntype StashApplyOptions struct {\n\tFlags            StashApplyFlag\n\tCheckoutOptions  CheckoutOptions            // options to use when writing files to the working directory\n\tProgressCallback StashApplyProgressCallback // optional callback to notify the consumer of application progress\n}\n```\nStashApplyOptions represents options to control the apply operation.\n\n```go\nfunc DefaultStashApplyOptions() (StashApplyOptions, error)\n```\nDefaultStashApplyOptions initializes the structure with default values.\n\n```go\ntype StashApplyProgress int\n```\nStashApplyProgress are flags describing the progress of the apply operation.\n\n```go\nconst (\n\t// StashApplyProgressNone means loading the stashed data from the object store.\n\tStashApplyProgressNone StashApplyProgress = C.GIT_STASH_APPLY_PROGRESS_NONE\n\n\t// StashApplyProgressLoadingStash means the stored index is being analyzed.\n\tStashApplyProgressLoadingStash StashApplyProgress = C.GIT_STASH_APPLY_PROGRESS_LOADING_STASH\n\n\t// StashApplyProgressAnalyzeIndex means the stored index is being analyzed.\n\tStashApplyProgressAnalyzeIndex StashApplyProgress = C.GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX\n\n\t// StashApplyProgressAnalyzeModified means the modified files are being analyzed.\n\tStashApplyProgressAnalyzeModified StashApplyProgress = C.GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED\n\n\t// StashApplyProgressAnalyzeUntracked means the untracked and ignored files are being analyzed.\n\tStashApplyProgressAnalyzeUntracked StashApplyProgress = C.GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED\n\n\t// StashApplyProgressCheckoutUntracked means the untracked files are being written to disk.\n\tStashApplyProgressCheckoutUntracked StashApplyProgress = C.GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED\n\n\t// StashApplyProgressCheckoutModified means the modified files are being written to disk.\n\tStashApplyProgressCheckoutModified StashApplyProgress = C.GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED\n\n\t// StashApplyProgressDone means the stash was applied successfully.\n\tStashApplyProgressDone StashApplyProgress = C.GIT_STASH_APPLY_PROGRESS_DONE\n)\n```\n\n```go\ntype StashApplyProgressCallback func(progress StashApplyProgress) error\n```\nStashApplyProgressCallback is the apply operation notification callback.\n\n```go\ntype StashCallback func(index int, message string, id *Oid) error\n```\nStashCallback is called per entry when interating over all the stashed states.\n\n'index' is the position of the current stash in the stash list, 'message' is the message used when creating the stash and 'id' is the commit id of the stash.\n\n```go\ntype StashCollection struct {\n\t// contains filtered or unexported fields\n}\n```\nStashCollection represents the possible operations that can be performed on the collection of stashes for a repository.\n\n```go\nfunc (c *StashCollection) Apply(index int, opts StashApplyOptions) error\n```\nApply applies a single stashed state from the stash list.\n\nIf local changes in the working directory conflict with changes in the stash then ErrorCodeConflict will be returned.  In this case, the index will always remain unmodified and all files in the working directory will remain unmodified.  However, if you are restoring untracked files or ignored files and there is a conflict when applying the modified files, then those files will remain in the working directory.\n\nIf passing the StashApplyReinstateIndex flag and there would be conflicts when reinstating the index, the function will return ErrorCodeConflict and both the working directory and index will be left unmodified.\n\nNote that a minimum checkout strategy of 'CheckoutSafe' is implied.\n\n'index' is the position within the stash list. 0 points to the most recent stashed state.\n\nReturns error code ErrorCodeNotFound if there's no stashed state for the given index, error code ErrorCodeConflict if local changes in the working directory conflict with changes in the stash, the user returned error from the StashApplyProgressCallback, if any, or other error code.\n\nError codes can be interogated with IsErrorCode(err, ErrorCodeNotFound).\n\n```go\nfunc (c *StashCollection) Drop(index int) error\n```\nDrop removes a single stashed state from the stash list.\n\n'index' is the position within the stash list. 0 points to the most recent stashed state.\n\nReturns error code ErrorCodeNotFound if there's no stashed state for the given index.\n\n```go\nfunc (c *StashCollection) Foreach(callback StashCallback) error\n```\nForeach loops over all the stashed states and calls the callback for each one.\n\nIf callback returns an error, this will stop looping.\n\n```go\nfunc (c *StashCollection) Pop(index int, opts StashApplyOptions) error\n```\nPop applies a single stashed state from the stash list and removes it from the list if successful.\n\n'index' is the position within the stash list. 0 points to the most recent stashed state.\n\n'opts' controls how stashes are applied.\n\nReturns error code ErrorCodeNotFound if there's no stashed state for the given index.\n\n```go\nfunc (c *StashCollection) Save(\n\tstasher *Signature, message string, flags StashFlag) (*Oid, error)\n```\nSave saves the local modifications to a new stash.\n\nStasher is the identity of the person performing the stashing. Message is the optional description along with the stashed state. Flags control the stashing process and are given as bitwise OR.\n\n```go\ntype StashFlag int\n```\nStashFlag are flags that affect the stash save operation.\n\n```go\nconst (\n\t// StashDefault represents no option, default.\n\tStashDefault StashFlag = C.GIT_STASH_DEFAULT\n\n\t// StashKeepIndex leaves all changes already added to the\n\t// index intact in the working directory.\n\tStashKeepIndex StashFlag = C.GIT_STASH_KEEP_INDEX\n\n\t// StashIncludeUntracked means all untracked files are also\n\t// stashed and then cleaned up from the working directory.\n\tStashIncludeUntracked StashFlag = C.GIT_STASH_INCLUDE_UNTRACKED\n\n\t// StashIncludeIgnored means all ignored files are also\n\t// stashed and then cleaned up from the working directory.\n\tStashIncludeIgnored StashFlag = C.GIT_STASH_INCLUDE_IGNORED\n)\n```\n\n```go\ntype Status int\n```\n\n```go\nconst (\n\tStatusCurrent         Status = C.GIT_STATUS_CURRENT\n\tStatusIndexNew        Status = C.GIT_STATUS_INDEX_NEW\n\tStatusIndexModified   Status = C.GIT_STATUS_INDEX_MODIFIED\n\tStatusIndexDeleted    Status = C.GIT_STATUS_INDEX_DELETED\n\tStatusIndexRenamed    Status = C.GIT_STATUS_INDEX_RENAMED\n\tStatusIndexTypeChange Status = C.GIT_STATUS_INDEX_TYPECHANGE\n\tStatusWtNew           Status = C.GIT_STATUS_WT_NEW\n\tStatusWtModified      Status = C.GIT_STATUS_WT_MODIFIED\n\tStatusWtDeleted       Status = C.GIT_STATUS_WT_DELETED\n\tStatusWtTypeChange    Status = C.GIT_STATUS_WT_TYPECHANGE\n\tStatusWtRenamed       Status = C.GIT_STATUS_WT_RENAMED\n\tStatusIgnored         Status = C.GIT_STATUS_IGNORED\n\tStatusConflicted      Status = C.GIT_STATUS_CONFLICTED\n)\n```\n\n```go\ntype StatusEntry struct {\n\tStatus         Status\n\tHeadToIndex    DiffDelta\n\tIndexToWorkdir DiffDelta\n}\n```\n\n```go\ntype StatusList struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (statusList *StatusList) ByIndex(index int) (StatusEntry, error)\n```\n\n```go\nfunc (statusList *StatusList) EntryCount() (int, error)\n```\n\n```go\nfunc (statusList *StatusList) Free()\n```\n\n```go\ntype StatusOpt int\n```\n\n```go\nconst (\n\tStatusOptIncludeUntracked      StatusOpt = C.GIT_STATUS_OPT_INCLUDE_UNTRACKED\n\tStatusOptIncludeIgnored        StatusOpt = C.GIT_STATUS_OPT_INCLUDE_IGNORED\n\tStatusOptIncludeUnmodified     StatusOpt = C.GIT_STATUS_OPT_INCLUDE_UNMODIFIED\n\tStatusOptExcludeSubmodules     StatusOpt = C.GIT_STATUS_OPT_EXCLUDE_SUBMODULES\n\tStatusOptRecurseUntrackedDirs  StatusOpt = C.GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS\n\tStatusOptDisablePathspecMatch  StatusOpt = C.GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH\n\tStatusOptRecurseIgnoredDirs    StatusOpt = C.GIT_STATUS_OPT_RECURSE_IGNORED_DIRS\n\tStatusOptRenamesHeadToIndex    StatusOpt = C.GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX\n\tStatusOptRenamesIndexToWorkdir StatusOpt = C.GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR\n\tStatusOptSortCaseSensitively   StatusOpt = C.GIT_STATUS_OPT_SORT_CASE_SENSITIVELY\n\tStatusOptSortCaseInsensitively StatusOpt = C.GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY\n\tStatusOptRenamesFromRewrites   StatusOpt = C.GIT_STATUS_OPT_RENAMES_FROM_REWRITES\n\tStatusOptNoRefresh             StatusOpt = C.GIT_STATUS_OPT_NO_REFRESH\n\tStatusOptUpdateIndex           StatusOpt = C.GIT_STATUS_OPT_UPDATE_INDEX\n)\n```\n\n```go\ntype StatusOptions struct {\n\tShow     StatusShow\n\tFlags    StatusOpt\n\tPathspec []string\n}\n```\n\n```go\ntype StatusShow int\n```\n\n```go\nconst (\n\tStatusShowIndexAndWorkdir StatusShow = C.GIT_STATUS_SHOW_INDEX_AND_WORKDIR\n\tStatusShowIndexOnly       StatusShow = C.GIT_STATUS_SHOW_INDEX_ONLY\n\tStatusShowWorkdirOnly     StatusShow = C.GIT_STATUS_SHOW_WORKDIR_ONLY\n)\n```\n\n```go\ntype Submodule struct {\n\t// contains filtered or unexported fields\n}\n```\nSubmodule\n\n```go\nfunc (sub *Submodule) AddToIndex(write_index bool) error\n```\n\n```go\nfunc (sub *Submodule) FetchRecurseSubmodules() SubmoduleRecurse\n```\n\n```go\nfunc (sub *Submodule) FinalizeAdd() error\n```\n\n```go\nfunc (sub *Submodule) Free()\n```\n\n```go\nfunc (sub *Submodule) HeadId() *Oid\n```\n\n```go\nfunc (sub *Submodule) Ignore() SubmoduleIgnore\n```\n\n```go\nfunc (sub *Submodule) IndexId() *Oid\n```\n\n```go\nfunc (sub *Submodule) Init(overwrite bool) error\n```\n\n```go\nfunc (sub *Submodule) Name() string\n```\n\n```go\nfunc (sub *Submodule) Open() (*Repository, error)\n```\n\n```go\nfunc (sub *Submodule) Path() string\n```\n\n```go\nfunc (sub *Submodule) Sync() error\n```\n\n```go\nfunc (sub *Submodule) Update(init bool, opts *SubmoduleUpdateOptions) error\n```\n\n```go\nfunc (sub *Submodule) UpdateStrategy() SubmoduleUpdate\n```\n\n```go\nfunc (sub *Submodule) Url() string\n```\n\n```go\nfunc (sub *Submodule) WdId() *Oid\n```\n\n```go\ntype SubmoduleCallback func(sub *Submodule, name string) int\n```\nSubmoduleCallback is a function that is called for every submodule found in SubmoduleCollection.Foreach.\n\n```go\ntype SubmoduleCbk = SubmoduleCallback\n```\nDeprecated: SubmoduleCbk is a deprecated alias of SubmoduleCallback.\n\n```go\ntype SubmoduleCollection struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *SubmoduleCollection) Add(url, path string, use_git_link bool) (*Submodule, error)\n```\n\n```go\nfunc (c *SubmoduleCollection) Foreach(callback SubmoduleCallback) error\n```\n\n```go\nfunc (c *SubmoduleCollection) Lookup(name string) (*Submodule, error)\n```\n\n```go\nfunc (c *SubmoduleCollection) SetFetchRecurseSubmodules(submodule string, recurse SubmoduleRecurse) error\n```\n\n```go\nfunc (c *SubmoduleCollection) SetIgnore(submodule string, ignore SubmoduleIgnore) error\n```\n\n```go\nfunc (c *SubmoduleCollection) SetUpdate(submodule string, update SubmoduleUpdate) error\n```\n\n```go\nfunc (c *SubmoduleCollection) SetUrl(submodule, url string) error\n```\n\n```go\ntype SubmoduleIgnore int\n```\n\n```go\nconst (\n\tSubmoduleIgnoreNone      SubmoduleIgnore = C.GIT_SUBMODULE_IGNORE_NONE\n\tSubmoduleIgnoreUntracked SubmoduleIgnore = C.GIT_SUBMODULE_IGNORE_UNTRACKED\n\tSubmoduleIgnoreDirty     SubmoduleIgnore = C.GIT_SUBMODULE_IGNORE_DIRTY\n\tSubmoduleIgnoreAll       SubmoduleIgnore = C.GIT_SUBMODULE_IGNORE_ALL\n)\n```\n\n```go\ntype SubmoduleRecurse int\n```\n\n```go\nconst (\n\tSubmoduleRecurseNo       SubmoduleRecurse = C.GIT_SUBMODULE_RECURSE_NO\n\tSubmoduleRecurseYes      SubmoduleRecurse = C.GIT_SUBMODULE_RECURSE_YES\n\tSubmoduleRecurseOndemand SubmoduleRecurse = C.GIT_SUBMODULE_RECURSE_ONDEMAND\n)\n```\n\n```go\ntype SubmoduleStatus int\n```\n\n```go\nconst (\n\tSubmoduleStatusInHead          SubmoduleStatus = C.GIT_SUBMODULE_STATUS_IN_HEAD\n\tSubmoduleStatusInIndex         SubmoduleStatus = C.GIT_SUBMODULE_STATUS_IN_INDEX\n\tSubmoduleStatusInConfig        SubmoduleStatus = C.GIT_SUBMODULE_STATUS_IN_CONFIG\n\tSubmoduleStatusInWd            SubmoduleStatus = C.GIT_SUBMODULE_STATUS_IN_WD\n\tSubmoduleStatusIndexAdded      SubmoduleStatus = C.GIT_SUBMODULE_STATUS_INDEX_ADDED\n\tSubmoduleStatusIndexDeleted    SubmoduleStatus = C.GIT_SUBMODULE_STATUS_INDEX_DELETED\n\tSubmoduleStatusIndexModified   SubmoduleStatus = C.GIT_SUBMODULE_STATUS_INDEX_MODIFIED\n\tSubmoduleStatusWdUninitialized SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_UNINITIALIZED\n\tSubmoduleStatusWdAdded         SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_ADDED\n\tSubmoduleStatusWdDeleted       SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_DELETED\n\tSubmoduleStatusWdModified      SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_MODIFIED\n\tSubmoduleStatusWdIndexModified SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED\n\tSubmoduleStatusWdWdModified    SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_WD_MODIFIED\n\tSubmoduleStatusWdUntracked     SubmoduleStatus = C.GIT_SUBMODULE_STATUS_WD_UNTRACKED\n)\n```\n\n```go\ntype SubmoduleUpdate int\n```\n\n```go\nconst (\n\tSubmoduleUpdateCheckout SubmoduleUpdate = C.GIT_SUBMODULE_UPDATE_CHECKOUT\n\tSubmoduleUpdateRebase   SubmoduleUpdate = C.GIT_SUBMODULE_UPDATE_REBASE\n\tSubmoduleUpdateMerge    SubmoduleUpdate = C.GIT_SUBMODULE_UPDATE_MERGE\n\tSubmoduleUpdateNone     SubmoduleUpdate = C.GIT_SUBMODULE_UPDATE_NONE\n)\n```\n\n```go\ntype SubmoduleUpdateOptions struct {\n\t*CheckoutOpts\n\t*FetchOptions\n}\n```\nSubmoduleUpdateOptions\n\n```go\ntype Tag struct {\n\tObject\n\t// contains filtered or unexported fields\n}\n```\nTag\n\n```go\nfunc (t *Tag) AsObject() *Object\n```\n\n```go\nfunc (t *Tag) Message() string\n```\n\n```go\nfunc (t *Tag) Name() string\n```\n\n```go\nfunc (t *Tag) Tagger() *Signature\n```\n\n```go\nfunc (t *Tag) Target() *Object\n```\n\n```go\nfunc (t *Tag) TargetId() *Oid\n```\n\n```go\nfunc (t *Tag) TargetType() ObjectType\n```\n\n```go\ntype TagForeachCallback func(name string, id *Oid) error\n```\nTagForeachCallback is called for each tag in the repository.\n\nThe name is the full ref name eg: \"refs/tags/v1.0.0\".\n\nNote that the callback is called for lightweight tags as well, so repo.LookupTag() will return an error for these tags. Use repo.References.Lookup() instead.\n\n```go\ntype TagsCollection struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (c *TagsCollection) Create(name string, obj Objecter, tagger *Signature, message string) (*Oid, error)\n```\n\n```go\nfunc (c *TagsCollection) CreateLightweight(name string, obj Objecter, force bool) (*Oid, error)\n```\nCreateLightweight creates a new lightweight tag pointing to an object and returns the id of the target object.\n\nThe name of the tag is validated for consistency (see git\\_tag\\_create() for the rules [https://libgit2.github.com/libgit2/#HEAD/group/tag/git\\_tag\\_create](https://libgit2.github.com/libgit2/#HEAD/group/tag/git_tag_create)) and should not conflict with an already existing tag name.\n\nIf force is true and a reference already exists with the given name, it'll be replaced.\n\nThe created tag is a simple reference and can be queried using repo.References.Lookup(\"refs/tags/\\\u003cname\u003e\"). The name of the tag (eg \"v1.0.0\") is queried with ref.Shorthand().\n\n```go\nfunc (c *TagsCollection) Foreach(callback TagForeachCallback) error\n```\nForeach calls the callback for each tag in the repository.\n\n```go\nfunc (c *TagsCollection) List() ([]string, error)\n```\nList returns the names of all the tags in the repository, eg: \\[\"v1.0.1\", \"v2.0.0\"].\n\n```go\nfunc (c *TagsCollection) ListWithMatch(pattern string) ([]string, error)\n```\nListWithMatch returns the names of all the tags in the repository that match a given pattern.\n\nThe pattern is a standard fnmatch(3) pattern [http://man7.org/linux/man-pages/man3/fnmatch.3.html](http://man7.org/linux/man-pages/man3/fnmatch.3.html)\n\n```go\nfunc (c *TagsCollection) Remove(name string) error\n```\n\n```go\ntype Trailer struct {\n\tKey   string\n\tValue string\n}\n```\nTrailer represents a single git message trailer.\n\n```go\nfunc MessageTrailers(message string) ([]Trailer, error)\n```\nMessageTrailers parses trailers out of a message, returning a slice of Trailer structs. Trailers are key/value pairs in the last paragraph of a message, not including any patches or conflicts that may be present.\n\n```go\ntype TransferProgress struct {\n\tTotalObjects    uint\n\tIndexedObjects  uint\n\tReceivedObjects uint\n\tLocalObjects    uint\n\tTotalDeltas     uint\n\tReceivedBytes   uint\n}\n```\n\n```go\ntype TransferProgressCallback func(stats TransferProgress) ErrorCode\n```\n\n```go\ntype Transport struct {\n\t// contains filtered or unexported fields\n}\n```\nTransport encapsulates a way to communicate with a Remote.\n\n```go\nfunc (t *Transport) SmartCertificateCheck(cert *Certificate, valid bool, hostname string) error\n```\nSmartCertificateCheck calls the certificate check for this transport.\n\n```go\nfunc (t *Transport) SmartCredentials(user string, methods CredType) (*Cred, error)\n```\nSmartCredentials calls the credentials callback for this transport.\n\n```go\nfunc (t *Transport) SmartProxyOptions() (*ProxyOptions, error)\n```\nSmartProxyOptions gets a copy of the proxy options for this transport.\n\n```go\ntype TransportMessageCallback func(str string) ErrorCode\n```\n\n```go\ntype Tree struct {\n\tObject\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (t *Tree) AsObject() *Object\n```\n\n```go\nfunc (t *Tree) EntryById(id *Oid) *TreeEntry\n```\nEntryById performs a lookup for a tree entry with the given SHA value.\n\nIt returns a \\*TreeEntry that is owned by the Tree. You don't have to free it, but you must not use it after the Tree is freed.\n\nWarning: this must examine every entry in the tree, so it is not fast.\n\n```go\nfunc (t *Tree) EntryByIndex(index uint64) *TreeEntry\n```\n\n```go\nfunc (t *Tree) EntryByName(filename string) *TreeEntry\n```\n\n```go\nfunc (t *Tree) EntryByPath(path string) (*TreeEntry, error)\n```\nEntryByPath looks up an entry by its full path, recursing into deeper trees if necessary (i.e. if there are slashes in the path)\n\n```go\nfunc (t *Tree) EntryCount() uint64\n```\n\n```go\nfunc (t *Tree) Walk(callback TreeWalkCallback) error\n```\n\n```go\ntype TreeBuilder struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (v *TreeBuilder) Free()\n```\n\n```go\nfunc (v *TreeBuilder) Insert(filename string, id *Oid, filemode Filemode) error\n```\n\n```go\nfunc (v *TreeBuilder) Remove(filename string) error\n```\n\n```go\nfunc (v *TreeBuilder) Write() (*Oid, error)\n```\n\n```go\ntype TreeEntry struct {\n\tName     string\n\tId       *Oid\n\tType     ObjectType\n\tFilemode Filemode\n}\n```\n\n```go\ntype TreeWalkCallback func(string, *TreeEntry) int\n```\n\n```go\ntype UpdateTipsCallback func(refname string, a *Oid, b *Oid) ErrorCode\n```\n\n","path":"github.com/libgit2/git2go/v28","name":"git","synopsis":"","isRedistributable":true}
