Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
083f63b4
Commit
083f63b4
authored
Mar 01, 2021
by
Amy Qualls
Committed by
Suzanne Selhorn
Mar 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revisions to the examples area
Tidy up the phrasing and formatting of the examples area.
parent
83af89ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
doc/api/repositories.md
doc/api/repositories.md
+19
-16
No files found.
doc/api/repositories.md
View file @
083f63b4
...
...
@@ -337,38 +337,41 @@ attribute.
### Examples
For these examples we use the project ID 42, and assume the project is hosted on
GitLab.com. The example API token we use is
`token`
. We use
[
curl
](
https://curl.se/
)
to perform the HTTP requests.
These examples use
[
cURL
](
https://curl.se/
)
to perform HTTP requests.
The example commands use these values:
Let's start with a basic example:
-
**Project ID**
: 42
-
**Location**
: hosted on GitLab.com
-
**Example API token**
:
`token`
This command generates a changelog for version
`1.0.0`
.
The commit range:
-
Starts with the tag of the last release.
-
Ends with the last commit on the target branch. The default target branch is the project's default branch.
If the last tag is
`v0.9.0`
and the default branch is
`main`
, the range of commits
included in this example is
`v0.9.0..main`
:
```
shell
curl
--header
"PRIVATE-TOKEN: token"
--data
"version=1.0.0"
"https://gitlab.com/api/v4/projects/42/repository/changelog"
```
This generates a changelog for version
`1.0.0`
. The start of the range of
commits to include is the tag of the last release. The end of the range is the
last commit on the target branch, which defaults to the project's default
branch. So if the last tag is
`v0.9.0`
, and the default branch is
`main`
, this
means the range of commits is
`v0.9.0..main`
.
If you want to generate the data on a different branch, you can do so as
follows:
To generate the data on a different branch, specify the
`branch`
parameter. This
command generates data from the
`foo`
branch:
```
shell
curl
--header
"PRIVATE-TOKEN: token"
--data
"version=1.0.0&branch=foo"
"https://gitlab.com/api/v4/projects/42/repository/changelog"
```
This generates the data on the
`foo`
branch.
A different trailer to use is specified as follows:
To use a different trailer, use the
`trailer`
parameter:
```
shell
curl
--header
"PRIVATE-TOKEN: token"
--data
"version=1.0.0&trailer=Type"
"https://gitlab.com/api/v4/projects/42/repository/changelog"
```
Or perhaps you want to store the results in a different file
:
To store the results in a different file, use the
`file`
parameter
:
```
shell
curl
--header
"PRIVATE-TOKEN: token"
--data
"version=1.0.0&file=NEWS"
"https://gitlab.com/api/v4/projects/42/repository/changelog"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment