summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-12-12 13:04:13 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2016-12-13 16:12:40 +0100
commit1a81fcfbd8261862c9614f0ea317af02ae20b24a (patch)
tree0305f26c3d02ab68c2ebc3ef4e9b2711213586b0 /doc
parentdb9e1635d0d17596193ecbee8e0acc1916918d1d (diff)
downloadgitlab-ce-1a81fcfbd8261862c9614f0ea317af02ae20b24a.tar.gz
API: Ability to cherry-pick a commit
Diffstat (limited to 'doc')
-rw-r--r--doc/api/commits.md39
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/api/commits.md b/doc/api/commits.md
index 0170af00e0e..5c11d0f83bb 100644
--- a/doc/api/commits.md
+++ b/doc/api/commits.md
@@ -183,6 +183,44 @@ Example response:
}
```
+## Cherry pick a commit
+
+> [Introduced][ce-8047] in GitLab 8.15.
+
+Cherry picks a commit to a given branch.
+
+```
+POST /projects/:id/repository/commits/:sha/cherry_pick
+```
+
+Parameters:
+
+| Attribute | Type | Required | Description |
+| --------- | ---- | -------- | ----------- |
+| `id` | integer/string | yes | The ID of a project or NAMESPACE/PROJECT_NAME owned by the authenticated user
+| `sha` | string | yes | The commit hash |
+| `branch` | string | yes | The name of the branch |
+
+```bash
+curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --form "branch=master" "https://gitlab.example.com/api/v3/projects/5/repository/commits/master/cherry_pick"
+```
+
+Example response:
+
+```json
+{
+ "id": "8b090c1b79a14f2bd9e8a738f717824ff53aebad",
+ "short_id": "8b090c1b",
+ "title": "Feature added",
+ "author_name": "Dmitriy Zaporozhets",
+ "author_email": "dmitriy.zaporozhets@gmail.com",
+ "created_at": "2016-12-12T20:10:39.000+01:00",
+ "committer_name": "Administrator",
+ "committer_email": "admin@example.com",
+ "message": "Feature added\n\nSigned-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>\n"
+}
+```
+
## Get the diff of a commit
Get the diff of a commit in a project.
@@ -438,3 +476,4 @@ Example response:
```
[ce-6096]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6096 "Multi-file commit"
+[ce-8047]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8047