@@ -193,11 +193,11 @@ POST /projects/:id/repository/branches
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | integer | yes | The ID of a project |
| `branch_name` | string | yes | The name of the branch |
| `branch` | string | yes | The name of the branch |
| `ref` | string | yes | The branch name or commit SHA to create branch from |
```bash
curl --request POST --header"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK""https://gitlab.example.com/api/v3/projects/5/repository/branches?branch_name=newbranch&ref=master"
curl --request POST --header"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK""https://gitlab.example.com/api/v3/projects/5/repository/branches?branch=newbranch&ref=master"
@@ -46,22 +46,22 @@ POST /projects/:id/repository/files
```
```bash
curl --request POST --header'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK''https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch_name=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20content&commit_message=create%20a%20new%20file'
curl --request POST --header'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK''https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20content&commit_message=create%20a%20new%20file'
```
Example response:
```json
{
"file_path":"app/project.rb",
"branch_name":"master"
"file_name":"app/project.rb",
"branch":"master"
}
```
Parameters:
-`file_path` (required) - Full path to new file. Ex. lib/class.rb
-`branch_name` (required) - The name of branch
-`branch` (required) - The name of branch
-`encoding` (optional) - Change encoding to 'base64'. Default is text.
-`author_email` (optional) - Specify the commit author's email address
-`author_name` (optional) - Specify the commit author's name
...
...
@@ -75,22 +75,22 @@ PUT /projects/:id/repository/files
```
```bash
curl --request PUT --header'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK''https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch_name=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20other%20content&commit_message=update%20file'
curl --request PUT --header'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK''https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20other%20content&commit_message=update%20file'
```
Example response:
```json
{
"file_path":"app/project.rb",
"branch_name":"master"
"file_name":"app/project.rb",
"branch":"master"
}
```
Parameters:
-`file_path` (required) - Full path to file. Ex. lib/class.rb
-`branch_name` (required) - The name of branch
-`branch` (required) - The name of branch
-`encoding` (optional) - Change encoding to 'base64'. Default is text.
-`author_email` (optional) - Specify the commit author's email address
-`author_name` (optional) - Specify the commit author's name