---
title: "Merge worktree to main"
method: POST
path: "/v1/git/worktrees/{id}/merge"
tags: ["git"]
---

# Merge worktree to main

`POST /v1/git/worktrees/{id}/merge`

Merges a local repo worktree's changes back to the main repository

## Path parameters

- `id` string, required

## Request body

- object

## Response `200`

OK

- InternalHandlersWorktreeOperationResponse — Response for worktree operations like delete, sync, merge, preview
  - `id` string — Worktree ID
  - `message` string — Operation result message
  - `strategy` string — Strategy used for sync operations

---

[API](https://skmtc.net/wandb/apis/catnip-container-api.md) · [All operations](https://skmtc.net/wandb/apis/catnip-container-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wandb/catnip-container-api/versions/a075b0fa501a/schema)
