### Method

# Ggit Submodule update

#### Declaration [src]

    void
    ggit_submodule_update (
      GgitSubmodule* submodule,
      gboolean init,
      GgitSubmoduleUpdateOptions* options,
      GError** error
    )

#### Description [src]

Update a submodule. This will clone a missing submodule and checkout the subrepository to the commit specified in the index of the containing repository. If the submodule repository doesn’t contain the target commit (e.g. because fetchRecurseSubmodules isn’t set), then the submodule is fetched using the fetch options supplied in options.

#### Parameters

`init`

  Type: `gboolean`

  If the submodule is not initialized, setting this flag to true will initialize the submodule before updating. Otherwise, this will return an error if attempting to update an uninitialzed repository. but setting this to true forces them to be updated.

`options`

  Type: `GgitSubmoduleUpdateOptions`

  A `GgitSubmoduleUpdateOptions` object.

  The data is owned by the caller of the method.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.