| name | hotfix-preview |
| description | Cherry-pick a commit from dev onto preview without a PR. Use when you need to cherry-pick a fix to preview without a PR, or for urgent fixes that can't wait for a full promote cycle. |
| argument-hint | [<commit-sha>] โ defaults to dev HEAD |
When to use
A fix is on dev and needs to reach preview (and then prod) immediately.
The full /promote flow creates a changelog PR that needs review and merge.
This skill skips the PR and cherry-picks directly.
Rules
- The commit must already exist on
dev. Do not cherry-pick unmerged work.
- Cherry-pick creates a new SHA on
preview. The original SHA stays on dev.
Both branches contain the same diff; history diverges by one merge-base commit.
This is fine โ /promote reconciles them on the next full promotion.
- Never force-push
preview or dev.
Task
set -euo pipefail
REMOTE="${REMOTE:-upstream}"
SHA="${1:-$(git rev-parse "$REMOTE/dev")}"
if ! git merge-base --is-ancestor "$SHA" "$REMOTE/dev"; then
echo "error: $SHA is not on $REMOTE/dev" >&2
exit 1
fi
git fetch "$REMOTE" preview
git switch preview
git pull --ff-only "$REMOTE" preview
git cherry-pick "$SHA"
git push "$REMOTE" preview
echo ""
echo "Cherry-picked $(git rev-parse --short "$SHA") onto preview as $(git log -1 --format='%h') โ $(git log -1 --format='%s')"