Stacked Git logo

Stacked Git



stg-push - Push (apply) one or more unapplied patches


stg push [OPTIONS] [patch]…​
stg push [OPTIONS] -n <number>
stg push [OPTIONS] --all


Push one or more unapplied patches from the series onto the stack.

By default, the first unapplied patch is pushed.

Unapplied patches may be pushed in arbitrary order, but out of order pushes may result in merge conflicts. If there are conflicts while pushing a patch, the conflicts are written to the work tree and the push command halts. Conflicts may then be resolved using the normal Git methods, or alternatively the push may be undone using stg undo.



Push all unapplied patches

-n <n>

Push the specified number of patches.

A negative number indicates to push all but that number of patches


Push the patches in reverse order


Reorder patches by pushing without applying


Push patches keeping their original trees.

For each patch pushed, instead of performing a merge, the patch is pushed such the resulting tree will be identical to the tree associated with the patch.

This can be useful when splitting a patch by first popping the patch and creating a new patch with some of the changes. Pushing the original patch with --set-tree will avoid conflicts and only the remaining changes will be in the patch.


Keep the local changes


Check for patches merged upstream


Part of the StGit suite - see stg(1)