# man > debdiff-apply(1)

---
type: CommandReference
command: debdiff-apply
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `debdiff-apply patch.diff` — apply patch from file to current directory
- `debdiff-apply < patch.diff` — apply patch from stdin
- `debdiff-apply orig.dsc patch.diff` — apply patch to a .dsc, producing a new .dsc
- `debdiff-apply --source-version patch.diff` — print the source version expected by the patch (no modification)
- `debdiff-apply --target-version orig.dsc patch.diff` — print the new version that would be generated
- `debdiff-apply --verbose orig.dsc patch.diff` — verbose output
- `debdiff-apply -d /tmp/work orig.dsc patch.diff` — extract .dsc to a specific directory (no cleanup)
- `debdiff-apply --quilt-refresh orig.dsc patch.diff` — retry with quilt refresh on failure

## Name

**debdiff-apply** — apply a debdiff to a Debian source package

## Synopsis

`debdiff-apply` [options] [orig_dsc_or_dir] [patch_file]

`debdiff-apply` [options] < [patch_file]

## Options

### General

- `-h, --help` — show help message and exit
- `-v, --verbose` — output more information
- `-c, --changelog` — path to `debian/changelog` (default: `debian/changelog`)
- `-D, --distribution` — distribution to use if the patch doesn't contain a changelog entry (default: `experimental`)
- `--repl` — run the Python REPL after processing
- `--source-version` — don't apply the patch; print the source version the patch is intended for, or nothing if not specified
- `--target-version` — don't apply the patch; print the version `debdiff-apply` would generate when applied to the given target

### For .dsc patch targets

- `--no-clean` — don't clean temporary directories after a failure (for debugging)
- `--quilt-refresh` — if building the new source package fails, try to refresh patches with `quilt` then retry
- `-d, --directory` — extract the .dsc into this directory (won't be cleaned up after exit); if not given, a temporary directory is used

## Examples

shell
# Apply a patch file to the current directory (assumed to be an unpacked source tree)
debdiff-apply mypatch.diff

# Apply a patch from stdin
debdiff-apply < mypatch.diff

# Apply a patch to a .dsc file, producing a new .dsc
debdiff-apply old.dsc patch.diff

# Show the source version that the patch expects
debdiff-apply --source-version patch.diff

# Show the target version that would be produced
debdiff-apply --target-version old.dsc patch.diff

# Use a specific working directory for .dsc extraction
debdiff-apply -d /tmp/work old.dsc patch.diff

# Enable quilt refresh on failure
debdiff-apply --quilt-refresh old.dsc patch.diff

# Verbose mode
debdiff-apply -v old.dsc patch.diff
## See Also

- [**debdiff**(1)](https://www.chedong.com/phpMan.php/man/debdiff/1/markdown)