Skip to main content
POST
/
api
/
v1
/
git
/
worktrees
Create worktree
curl --request POST \
  --url http://localhost:3000/api/v1/git/worktrees \
  --header 'Content-Type: application/json' \
  --cookie nut-session= \
  --data '
{
  "path": "<string>",
  "branch": "<string>",
  "createBranch": false
}
'
{
  "success": true,
  "data": {
    "worktree": {
      "path": "<string>",
      "branch": "<string>",
      "commit": "<string>",
      "locked": true,
      "prunable": true
    }
  }
}

Authorizations

nut-session
string
cookie
required

Session cookie authentication

Body

application/json
path
string
required

Worktree path

branch
string
required

Branch name

createBranch
boolean
default:false

Create new branch

Response

Worktree created

success
boolean
required
data
object