ssh_apply_patch
Apply a unified diff to a remote SSH host, trying multiple patch strategies with support for dry-run and configurable strip levels to verify changes before committing them.
Instructions
Apply a unified diff on the remote host. Tries apply_patch (strip=0 only), then git apply, then patch. Supports dry-run and strip level.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patch | Yes | Unified diff to apply. | |
| strip | No | Number of leading path components to strip (-p<N>). | |
| target | Yes | SSH target in the form user@host[:port]. Uses the local SSH config and keys. | |
| dry_run | No | Simulate the patch application without changing files. |