summaryrefslogtreecommitdiff
path: root/doc/api/repository_files.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/repository_files.md')
-rw-r--r--doc/api/repository_files.md29
1 files changed, 16 insertions, 13 deletions
diff --git a/doc/api/repository_files.md b/doc/api/repository_files.md
index 70b804c368e..0dc50543f1e 100644
--- a/doc/api/repository_files.md
+++ b/doc/api/repository_files.md
@@ -183,10 +183,11 @@ POST /projects/:id/repository/files/:file_path
```
```shell
-curl --request POST --header 'PRIVATE-TOKEN: <your_access_token>' --header "Content-Type: application/json" \
- --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \
- "content": "some content", "commit_message": "create a new file"}' \
- "https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb"
+curl --request POST --header 'PRIVATE-TOKEN: <your_access_token>' \
+ --header "Content-Type: application/json" \
+ --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \
+ "content": "some content", "commit_message": "create a new file"}' \
+ "https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb"
```
Example response:
@@ -218,10 +219,11 @@ PUT /projects/:id/repository/files/:file_path
```
```shell
-curl --request PUT --header 'PRIVATE-TOKEN: <your_access_token>' --header "Content-Type: application/json" \
- --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \
- "content": "some content", "commit_message": "update file"}' \
- "https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb"
+curl --request PUT --header 'PRIVATE-TOKEN: <your_access_token>' \
+ --header "Content-Type: application/json" \
+ --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \
+ "content": "some content", "commit_message": "update file"}' \
+ "https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb"
```
Example response:
@@ -253,7 +255,7 @@ error message. Possible causes for a failed commit include:
user tried to make an empty commit;
- the branch was updated by a Git push while the file edit was in progress.
-Currently GitLab Shell has a boolean return code, preventing GitLab from specifying the error.
+GitLab Shell has a boolean return code, preventing GitLab from specifying the error.
## Delete existing file in repository
@@ -264,10 +266,11 @@ DELETE /projects/:id/repository/files/:file_path
```
```shell
-curl --request DELETE --header 'PRIVATE-TOKEN: <your_access_token>' --header "Content-Type: application/json" \
- --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \
- "commit_message": "delete file"}' \
- "https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb"
+curl --request DELETE --header 'PRIVATE-TOKEN: <your_access_token>' \
+ --header "Content-Type: application/json" \
+ --data '{"branch": "master", "author_email": "author@example.com", "author_name": "Firstname Lastname", \
+ "commit_message": "delete file"}' \
+ "https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb"
```
Parameters: