Use this API to update Git submodules.
Update a submodule reference
PUT /api/v4/projects/{id}/repository/submodules/{submodule}
Updates a reference for a specified submodule. Used in workflows, especially automated ones, to keep other projects that use the submodule up to date.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | ID or URL- Example: gitlab- |
submodulePath, | String | URL-lib%2Example: gitlab- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
branchRequired | String | Name of the branch to commit into Example: main |
commit_ | String | Commit message. Example: Commit message |
commit_Required | String | Full commit SHA to update the submodule to Example: ed899a2f4b50b4370fee |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | The repository is empty | — |
401 | 401 Unauthorized | — |
404 | 404 Project Not Found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesCommitDetail
| Property | Type | Description |
|---|---|---|
author_ | String | Email address of the commit author Example: john@example. |
author_ | String | Name of the commit author Example: John Smith |
authored_ | String (date- | Date and time when the commit was authored Example: 2012- |
committed_ | String (date- | Date and time when the commit was committed Example: 2012- |
committer_ | String | Email address of the committer Example: jack@example. |
committer_ | String | Name of the committer Example: Jack Smith |
created_ | String (date- | Date and time when the commit was created.committed_Example: 2017- |
extended_ | Object | Git trailers parsed from the commit message, Example: {"Signed- |
id | String | Full SHA of the commit Example: 2695effb5807a22ff3d1 |
last_ | Object | Latest pipeline for the commit |
message | String | Full commit message Example: Initial commit |
parent_ | Array of strings | SHAs of the parent commits Example: ["2a4b78934375d7f53875 |
project_ | Integer (int64) | Example:1 |
short_ | String | Short SHA of the commit Example: 2695effb |
stats | APIEntities | Number of lines added and deleted in the commit,stats is true, |
status | String | Status of the latest pipeline for the commit Example: success |
title | String | Title of the commit message Example: Initial commit |
trailers | Object | Git trailers parsed from the commit message. Example: {"Merged- |
web_ | String | URL to view the commit in the Git Example: https: |
APIEntitiesCommitStats
| Property | Type | Description |
|---|---|---|
additions | Integer | Example:1 |
deletions | Integer | Example:0 |
total | Integer | Example:1 |