---
title: rattler-build debug create-patch
---
<!--- This file is autogenerated. Do not edit manually! -->
# [rattler-build](../index.md) [debug](index.md) create-patch

Create a patch from changes in the work directory

## Usage
```
rattler-build debug create-patch [OPTIONS]
```

## Options
- <a id="arg---directory" href="#arg---directory">`--directory (-d) <DIRECTORY>`</a>
:  Directory where we want to create the patch. Defaults to current directory if not specified
- <a id="arg---name" href="#arg---name">`--name <NAME>`</a>
:  The name for the patch file to create
<br>**default**: `changes`
- <a id="arg---overwrite" href="#arg---overwrite">`--overwrite`</a>
:  Whether to overwrite the patch file if it already exists
<br>**default**: `false`
- <a id="arg---patch-dir" href="#arg---patch-dir">`--patch-dir <DIR>`</a>
:  Optional directory where the patch file should be written. Defaults to the recipe directory determined from `.source_info.json` if not provided
- <a id="arg---exclude" href="#arg---exclude">`--exclude <EXCLUDE>`</a>
:  Comma-separated list of file names (or glob patterns) that should be excluded from the diff
<br>May be provided more than once.
- <a id="arg---add" href="#arg---add">`--add <ADD>`</a>
:  Include new files matching these glob patterns (e.g., "*.txt", "src/**/*.rs")
<br>May be provided more than once.
- <a id="arg---include" href="#arg---include">`--include <INCLUDE>`</a>
:  Only include modified files matching these glob patterns (e.g., "*.c", "src/**/*.rs") If not specified, all modified files are included (subject to --exclude)
<br>May be provided more than once.
- <a id="arg---dry-run" href="#arg---dry-run">`--dry-run`</a>
:  Perform a dry-run: analyze changes and log the diff, but don't write the patch file
<br>**default**: `false`

## Description
Create a patch from changes in the work directory.

Generates a unified diff between the original sources and your modifications. The patch file is written to the recipe directory so you can add it to the recipe's `patches:` list.

