Stacked Git logo

Stacked Git



stg-delete - Delete patches


stg delete [OPTIONS] <patch>…​
stg delete [OPTIONS] --top


Delete patches



Delete the patches, but without modifying the index and worktree. This only works when deleting applied patches at the top of the stack. The effect is to "spill" the patch contents into the index and worktree.

This can be useful for splitting a patch into smaller pieces.


Delete topmost patch

-b <branch>

Use <branch> instead of current branch


Either "allow" or "disallow" pushing a patch with conflicts.

Using --conflicts=allow (or just --conflicts) allows pushing a patch that may result in unresolved merge conflicts. The patch will be pushed and files with conflicts will be left with conflict markers to be resolved manually; or the operation undone with stg undo --hard. This is the default behavior and also corresponds to the "stgit.push.allow-conflicts" variable being set to "true".

Using --conflicts=disallow disallows pushing any patch that would result in merge conflicts. The operation will stop on the last patch that can be pushed without conflicts. This behavior can be configured by setting "stgit.push.allow-conflicts" to "false".


Part of the StGit suite - see stg(1)