CreateCommitWithMultipleFiles
Creates a commit that includes changes to multiple files. This API is typically used in daily development when a single commit involves modifications to multiple files.
Try it now
Test
RAM authorization
Request syntax
POST /api/v4/projects/repository/commits/files HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| organizationId |
string |
Yes |
The enterprise identifier, also known as the enterprise ID. This is a string that can be obtained from the Yunxiao URL, such as https://devops.aliyun.com/organization/[OrganizationId]. |
5ebbc0228123212b59xxxxx |
| accessToken |
string |
No |
The personal access token. This field is not required if you use an Alibaba Cloud AccessKey ID and AccessKey secret or Security Token Service (STS) temporary authorization. |
f0b1e61db5961df5975a93f9129d2513 |
| repositoryIdentity |
string |
Yes |
The ID or full path of the code repository. |
2835387 or codeup/codeup-demo |
| body |
object |
No |
The request body. |
|
| branch |
string |
Yes |
The name of the code branch. |
master |
| commitMessage |
string |
No |
The commit message. |
auto |
| actions |
array<object> |
Yes |
The array of actions. Each action represents an operation on a file. |
|
|
object |
No |
The action information. |
||
| action |
string |
No |
The operation type. Valid values:
|
create |
| filePath |
string |
No |
The file path. |
src/test.java |
| previousPath |
string |
No |
The file path before the change. |
src/main/test.java |
| content |
string |
No |
The file content. Important If the operation is an update, the content is completely overwritten. The passed content directly overwrites the original file content. |
Hello, Codeup! |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| requestId |
string |
The request ID. |
A7586FEB-E48D-5579-983F-74981FBFF627 |
| success |
boolean |
Indicates whether the call was successful. |
true |
| errorCode |
string |
The error code. |
"" |
| errorMsg |
string |
The error message. |
error |
| result |
object |
The returned result. Note
The result returned by this API is the commit information. |
|
| id |
string |
The commit ID. |
de02b625ba8488f92eb204bcb3773a40c1b4ddac |
| shortId |
string |
The short commit ID. |
de02b625 |
| title |
string |
The commit title, which is the first line of the commit message. |
Commit title |
| message |
string |
The commit content. |
Specific commit content |
| authorName |
string |
The name of the author. |
test-codeup |
| authorEmail |
string |
The email address of the author. |
username@example.com |
| authoredDate |
string |
The time when the author made the commit. The format is YYYY-MM-DD HH:mm:ss. |
2022-03-18 15:00:00 |
| committerName |
string |
The name of the committer. |
committer-codeup |
| committerEmail |
string |
The email address of the committer. |
username@example.com |
| committedDate |
string |
The time when the committer made the commit. The format is YYYY-MM-DD HH:mm:ss. |
2022-03-18 16:00:00 |
| parentIds |
array |
The list of parent commit IDs. |
|
|
string |
The parent commit ID. |
ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 |
|
| createdAt |
string |
The creation time. The format is YYYY-MM-DD HH:mm:ss. |
2022-03-18 14:24:54 |
| author |
object |
The author information. |
|
| id |
integer |
The user ID in Codeup. |
19927 |
| aliyunPk |
string |
The Alibaba Cloud account ID. |
1234567890 |
| name |
string |
The name of the user. |
test-codeup |
| username |
string |
The logon name of the user. |
test-codeup |
|
string |
The email address of the user. |
username@example.com |
|
| state |
string |
The user status. Valid values:
|
active |
| avatarUrl |
string |
The URL of the avatar. |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100 |
| websiteUrl |
string |
The URL of the user's personal website. |
"" |
| committer |
object |
The committer information. |
|
| id |
integer |
The user ID in Codeup. |
24661 |
| aliyunPk |
string |
The Alibaba Cloud account ID. |
1234567890 |
| name |
string |
The name of the user. |
committer-codeup |
| username |
string |
The logon name of the user. |
committer-codeup |
|
string |
The email address of the user. |
username@example.com |
|
| state |
string |
The user status. Valid values:
|
active |
| avatarUrl |
string |
The URL of the avatar. |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
| websiteUrl |
string |
The URL of the user's personal website. |
"" |
Examples
Success response
JSON format
{
"requestId": "A7586FEB-E48D-5579-983F-74981FBFF627",
"success": true,
"errorCode": "\"\"",
"errorMsg": "error",
"result": {
"id": "de02b625ba8488f92eb204bcb3773a40c1b4ddac",
"shortId": "de02b625",
"title": "Commit title",
"message": "Specific commit content",
"authorName": "test-codeup",
"authorEmail": "username@example.com",
"authoredDate": "2022-03-18 15:00:00",
"committerName": "committer-codeup",
"committerEmail": "username@example.com",
"committedDate": "2022-03-18 16:00:00",
"parentIds": [
"ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 "
],
"createdAt": "2022-03-18 14:24:54",
"author": {
"id": 19927,
"aliyunPk": "1234567890",
"name": "test-codeup",
"username": "test-codeup",
"email": "username@example.com",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100",
"websiteUrl": "\"\""
},
"committer": {
"id": 24661,
"aliyunPk": "1234567890",
"name": "committer-codeup",
"username": "committer-codeup",
"email": "username@example.com",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"websiteUrl": "\"\""
}
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.