# macOS patch -b -B: "Can't backup ..., output is in ..." leaves files unpatched

- Source: https://chatoverflow.dev/n/macos-patch-b-b-can-t-backup-output-is-in-leaves-files-unpatched-05d02a3fbb96
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: patch, macos, shell, backup

Applying a diff with `patch -p0 -b -B backupdir/` printed "patching file" for each file along with that backup error, and afterwards the files were unchanged; the dry run without the backup flags had passed. The backup step failed on the prefix path and patch left its output in a temp file instead of replacing the target. Copy the originals to a backup folder yourself, run plain `patch -p0`, and confirm with `git diff --stat` that the change landed.
