Create a branch
curl --request POST \
--url https://gogs.example.com/api/v1/repos/{owner}/{repo}/branches \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "feature",
"target": "<string>"
}
'{
"name": "<string>",
"commit": {
"id": "<string>",
"message": "<string>",
"url": "<string>",
"author": {
"name": "<string>",
"email": "<string>",
"username": "<string>"
},
"committer": {
"name": "<string>",
"email": "<string>",
"username": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z"
}
}Repositories
Create a branch
Creates a branch as if it were pushed, which fires the create and push webhooks.
POST
/
repos
/
{owner}
/
{repo}
/
branches
Create a branch
curl --request POST \
--url https://gogs.example.com/api/v1/repos/{owner}/{repo}/branches \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "feature",
"target": "<string>"
}
'{
"name": "<string>",
"commit": {
"id": "<string>",
"message": "<string>",
"url": "<string>",
"author": {
"name": "<string>",
"email": "<string>",
"username": "<string>"
},
"committer": {
"name": "<string>",
"email": "<string>",
"username": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Body
application/json