Skip to main content
POST
/
api
/
v1
/
git
/
commits
Create commit
curl --request POST \
  --url http://localhost:3000/api/v1/git/commits \
  --header 'Content-Type: application/json' \
  --cookie nut-session= \
  --data '
{
  "message": "<string>",
  "files": [
    "<string>"
  ]
}
'
{
  "success": true,
  "data": {
    "commit": {
      "sha": "<string>",
      "message": "<string>",
      "shortSha": "<string>",
      "author": {
        "name": "<string>",
        "email": "<string>",
        "date": "2023-11-07T05:31:56Z"
      },
      "committer": {
        "name": "<string>",
        "email": "<string>",
        "date": "2023-11-07T05:31:56Z"
      },
      "parents": [
        "<string>"
      ]
    }
  }
}

Authorizations

nut-session
string
cookie
required

Session cookie authentication

Body

application/json
message
string
required

Commit message

files
string[]

Files to stage (optional, stages all if not provided)

Response

Commit created

success
boolean
required
data
object