pushNamespaceBranch
POST
/api/v1/namespaces/{namespace}/git/push
const url = 'https://example.com/api/v1/namespaces/example/git/push';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"changes":[{"content":"example","content_base64":"example","executable":true,"new_path":"example","op":"put","path":"example"}],"message":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/namespaces/example/git/push \ --header 'Content-Type: application/json' \ --data '{ "changes": [ { "content": "example", "content_base64": "example", "executable": true, "new_path": "example", "op": "put", "path": "example" } ], "message": "example" }'Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”namespace
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
changes
required
Array<object>
object
content
Put only. UTF-8 text content.
string
content_base64
Put only. Binary content as base64.
string
executable
boolean
new_path
Rename only.
string
op
required
string
path
required
string
key
additional properties
any
message
required
string
key
additional properties
any
Responses
Section titled “ Responses ”Created
Media typeapplication/json
object
branch
required
string
sha
required
string
key
additional properties
any
Examplegenerated
{ "branch": "example", "sha": "example"}default
Section titled “default”Error
Media typeapplication/json
object
error
required
object
code
required
string
details
message
required
string
key
additional properties
any
key
additional properties
any
Examplegenerated
{ "error": { "code": "example", "details": "example", "message": "example" }}