Ggit.Index
Description: Reference for Ggit.Index

### Class

# GgitIndex

#### Description [src]

    final class Ggit.Index : Ggit.Native {
      /* No available fields */
    }

Represents an index object.

#### Hierarchy

#### Ancestors

- GgitNative
- GgitObjectFactoryBase
- GObject

#### Implements

- GInitable

#### Functions

###### ggit_index_open

Create a new bare Git index object as a memory representation of the Git index file in `file`, without a repository to back it.

#### Instance methods

###### ggit_index_add

Add a file to the index.

###### ggit_index_add_file

Add a file to the index. The specified file must be in the working directory and must exist and be readable.

###### ggit_index_add_path

Add a file to the index by path. You can specify both relative paths (to the working directory) and absolute paths. Absolute paths however must reside in the working directory. The specified path must exist and must be readable.

###### ggit_index_get_entries

Get the index entries enumerator.

###### ggit_index_get_entries_resolve_undo

Get the resolve undo entries enumerator.

###### ggit_index_get_owner

Get the `GgitRepository` that owns the index.

###### ggit_index_has_conflicts

Get whether the index has any conflicts.

###### ggit_index_read

Update the contents of an existing index object in memory by reading from the hard disk.

###### ggit_index_remove

Remove a file from the index (specified by position).

###### ggit_index_write

Write an existing index object from memory back to disk using an atomic file lock.

###### ggit_index_write_tree

Write a new tree object to disk containing a representation of the current state of the index. The index must be associated to an existing repository and must not contain any files in conflict. You can use the resulting tree to for instance create a commit.

###### ggit_index_write_tree_to

Write a new tree object to `repository` containing a representation of the current state of the index. The index must not contain any files in conflict. You can use the resulting tree to for instance create a commit.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

##### Methods inherited from GInitable (1)

###### g_initable_init

Initializes the object implementing the interface.

unstable since: 2.22

#### Properties

###### Ggit.Index:file

No description available.

##### Properties inherited from GgitNative (1)

###### Ggit.Native:native

No description available.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GgitIndexClass {
      GgitNativeClass parent_class;

    }

No description available.

###### Class members

`parent_class: GgitNativeClass`
  No description available.