Ggit – 1.0
Description: Reference for Ggit-1.0

### Namespace

# Ggit – 1.0

libgit2-glib is a glib wrapper library around the libgit2 git access library.

Version | 1.2.0
Authors | The libgit2-glib authors
License | LGPL2+
Website | https://wiki.gnome.org/Projects/Libgit2-glib
Source | https://gitlab.gnome.org/GNOME/libgit2-glib

#### Build

C headers | `libgit2-glib/ggit.h`
pkg-config files | `libgit2-glib-1.0`

#### Dependencies

GLib—2.0 | The base type system library
| Browse documentation
GObject—2.0 | The base type system library
| Browse documentation
Gio—2.0 | GObject interfaces and objects
| Browse documentation

#### Additional documentation

- Classes Hierarchy

#### Classes

Blame | Represents a blame.
Blob | Represents a blob object.
BlobOutputStream | Represents a blob stream object.
Branch | Represents a branch object.
CheckoutOptions | Represents the options used when doign a checkout.
CherryPickOptions | Represents the options used when doign a cherry-pick.
CloneOptions | Represents the options used when cloning.
Commit | Represents a commit object.
CommitParents | Represents the parents of a commit object.
Config | Represents a git configuration.
Cred | Represents a git credential.
CredPlaintext | Represents a plain text credential.
CredSshInteractive | Represents a ssh interactive credential.
CredSshKeyFromAgent | Represents a ssh key agent credential.
Diff | Represents a diff list.
DiffFindOptions | Represents options for finding diff similarity.
DiffFormatEmailOptions |
DiffOptions | Represents the options used when creating a `GgitDiff`.
Index | Represents an index object.
Mailmap | Represents a mailmap.
Native | Represents a generic native object.
Object | Represents a generic object in a repository.
ObjectFactory | Represents an object factory.
ObjectFactoryBase | Represents the base type for objects created by an object factory.
ProxyOptions | Represents a git proxy options.
PushOptions | Represents a git push options.
Rebase | Represents a rebase object.
Ref | Reprensents a git reference.
Remote | Represents a git remote.
RemoteCallbacks | Represents a git remote callbacks.
Repository | Represents an existing git repository including all of it’s object contents.
RevisionWalker | Represents a revision walker.
Signature | Represents an action signature.
SubmoduleUpdateOptions | Represents options for a submodule update.
Tag | Represents a tag object.
Tree | Represents a tree object.
TreeBuilder | Represents a tree object.

#### Structs

AnnotatedCommit | Represents an annotated commit object.
BlameHunk | Represents a blame hunk.
BlameOptions | Represents blame options.
BranchEnumerator | Represents a branch enumerator.
ConfigEntry | Represents a git configuration entry.
CredSshInteractivePrompt | Represents a ssh interactive prompt.
DiffBinary | Represents a diff binary.
DiffBinaryFile | Represents a diff binary file.
DiffDelta | Represents the changes done to one file.
DiffFile | Represents a file in a `GgitDiff`.
DiffHunk | Represents the hunk of a diff.
DiffLine | Represents the line of a diff.
DiffSimilarityMetric | Represents a similarity metric.
FetchOptions | Represents a git fetch options.
IndexEntries | Represents the entries in an index object.
IndexEntriesResolveUndo | Represents the resolve undo entries in an index object.
IndexEntry | Represents an index entry object.
IndexEntryResolveUndo | Represents an resolve undo index entry object.
MergeOptions | Represents the options used when merging.
Note | Represents a note object.
OId | Represents a unique ID of any object.
Patch | Represents a patch object.
RebaseOperation | Represents a rebase operation.
RebaseOptions | Represents the options used when rebasing.
Reflog | Represents a reflog.
ReflogEntry | Represents a reflog entry.
RefSpec | Reprensents a git reference specification.
RemoteHead | Represents a git remote head.
RevertOptions | Represents the options used when reverting.
StatusOptions | Represents the options used when creating getting file status.
Submodule | Represents a git submodule.
TransferProgress | Represents transfering progress.
TreeEntry | Represents an entry in a tree.

#### Enumerations

BranchType | The type of a branch.
CloneLocal |
ConfigLevel | Priority level of a config file. These priority levels correspond to the natural escalation logic (from higher to lower) when searching for config entries in git.git.
DeltaType | Describes the type of change the delta is.
DiffBinaryType | When producing a binary diff, the binary data returned will be either the deflated full (“literal”) contents of the file, or the deflated binary delta between the two sides (whichever is smaller).
DiffFormatType | Possible output formats for diff data.
DiffLineType | These values describe where a line came from and will be passed to the `GgitDiffLineCallback` when iterating over a diff.
Direction |
FileMode |
MergeFileFavor |
PackbuilderStage | Valid stages for pack building.
ProxyType | The type of proxy to use.
RebaseOperationType | Type of rebase operation in-progress.
RefType | Describes the type a reference is.
RemoteCompletionType | Argument to the completion callback which tells it which operation finished.
RemoteDownloadTagsType | Automatic tag following option.
ResetType | Describes the type of reset to perform.
StatusShow | Show options for #ggit_repository_file_status_foreach. Determines which files are included in the status.
SubmoduleIgnore | Describes which submodules should be ignored.
SubmoduleRecurse | Options for submodule recurse. Represents the value of `submodule.$name.fetchRecurseSubmodules`
SubmoduleUpdate | Describes how a submodule should be updated.
TreeWalkMode | Describes in which order a tree walk should be performed.

#### Bitfields

AttributeCheckFlags | Attribute check flags indicate the order in which to check for gitattributes. git core uses `GGIT_ATTRIBUTE_CHECK_FILE_THEN_INDEX` for all operations, except on checkout, where it uses `GGIT_ATTRIBUTE_CHECK_INDEX_THEN_FILE`.
BlameFlags |
CheckoutNotifyFlags |
CheckoutStrategy |
CreateFlags | Describes how something should be created.
Credtype |
DiffFindFlags |
DiffFlag | Describes the diff file and/or delta flags.
DiffFormatEmailFlags |
DiffOption | How the diff should be generated.
FeatureFlags |
MergeFileFlags |
MergeFlags |
SortMode | The type of sorting mode for the revision walker.
StashFlags | Describes how a stash should be applied.
StatusFlags | Describes a file’s status.
StatusOption | should be processed between the head and the index and enables the GIT_STATUS_INDEX_RENAMED as a possible status flag. GGIT_STATUS_OPTION_RENAMES_INDEX_TO_WORKDIR: indicates tha rename detection should be run between the index and the working directory and enabled GIT_STATUS_WT_RENAMED as a possible status flag. GGIT_STATUS_OPTION_SORT_CASE_SENSITIVELY: sort case sensitive. GGIT_STATUS_OPTION_SORT_CASE_INSENSITIVELY: sort case insensitive. GGIT_STATUS_OPTION_DEFAULT: default flags. Status options specified when using #ggit_repository_file_status_foreach.
SubmoduleStatus | FIXME.

#### Error Domains

Error | Error codes for the `GGIT_ERROR` error domain.

#### Callbacks

ConfigCallback | The type of the callback functions for retrieving values from a `GgitConfig`. See ggit_config_foreach().
ConfigMatchCallback | The type of the callback functions for retrieving values from a `GgitConfig` using a regular expression. See ggit_config_match_foreach().
CredAcquireCallback | Signature of a function which acquires a credential object.
DiffBinaryCallback | Called for each file.
DiffFileCallback | Called for each file.
DiffHunkCallback | Called for each hunk.
DiffLineCallback | Called for each line.
DiffSimilarityMetricBufferSignatureCallback |
DiffSimilarityMetricFileSignatureCallback |
DiffSimilarityMetricFreeSignatureCallback |
DiffSimilarityMetricSimilarityCallback |
NoteCallback | When iterating over all the notes, callback that will be issued per note. See ggit_repository_note_foreach().
ReferencesCallback | The type of the callback functions for retrieving the references in a `GgitRepository`. See ggit_repository_references_foreach().
ReferencesNameCallback | The type of the callback functions for retrieving the references in a `GgitRepository`. See ggit_repository_references_foreach_name().
RemoteListCallback | The type of the callback functions for listing the references of a `GgitRemote`. See ggit_remote_list().
StashCallback | When iterating over all the stashed states, callback that will be issued per entry. See ggit_repository_stash_foreach().
StatusCallback | The type of the callback functions for retrieving the status of the files in a `GgitRepository`. See ggit_repository_file_status_foreach().
SubmoduleCallback | The type of the callback functions for retrieving the submodules in a `GgitRepository`. See ggit_repository_submodule_foreach().
TagCallback | When iterating over all the tags, callback that will be issued per entry. See ggit_repository_tag_foreach().
TransferProgressCallback | Progress callbacks during indexing.
TreeWalkCallback | The type of the callback functions for walking a tree. See ggit_tree_walk().

#### Functions

get_features | Gets the features of the library.
init | Call this function before using any other libgit2-glib function.
message_prettify | Prettify a commit message by removing excess whitespace and making sure the last line ends with a newline. If `strip_comments` is `TRUE`, then lines starting with a `comment_char` will be removed.

#### Function Macros

CHECK_VERSION | Compile-time version checking. Evaluates to `TRUE` if the version of libgit2-glib is greater than the required one.
ENCODE_VERSION |
OID |

#### Constants

BUILD_TYPE | The build type of the installed build.
MAJOR_VERSION | Libgit2-glib major version component (e.g. 1 if `GGIT_VERSION` is 1.2.3)
MINOR_VERSION | Libgit2-glib minor version component (e.g. 2 if `GGIT_VERSION` is 1.2.3)
VERSION_S | Libgit2-glib version, encoded as a string, useful for printing and concatenation.