From 0ba0a7fb4c96951d00fb5bab3b5e3e971852bf9a Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 10 Apr 2026 10:55:41 +0200 Subject: [PATCH] docs(stacks): add checkout command and --base option Document `mergify stack checkout` for team collaboration (picking up a teammate's stack locally) and `--base` option for branching from non-default branches. Co-Authored-By: Claude Opus 4.6 (1M context) Change-Id: I16a5449f6585ed4e5e06f02055740c93857dcd6c Claude-Session-Id: a911b6ad-5466-48a4-b4d3-85198ebc7c28 --- src/content/docs/stacks/creating.mdx | 6 ++++++ src/content/docs/stacks/setup.mdx | 16 +++++++++++++--- src/content/docs/stacks/team.mdx | 13 +++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/content/docs/stacks/creating.mdx b/src/content/docs/stacks/creating.mdx index 76ddd2ac86..4d30ab32b5 100644 --- a/src/content/docs/stacks/creating.mdx +++ b/src/content/docs/stacks/creating.mdx @@ -23,6 +23,12 @@ This is equivalent to `git checkout -b feat/my-feature --track origin/main`. You can also create branches however you normally do. Stacks doesn't require its own branch creation command. +To branch from something other than `main` (a release branch, for example): + +```bash +mergify stack new feat/my-feature --base origin/release-v2 +``` + ## Make Commits Work normally. Each commit should represent one logical unit of work, something diff --git a/src/content/docs/stacks/setup.mdx b/src/content/docs/stacks/setup.mdx index d1dd3ef865..8f85dccc54 100644 --- a/src/content/docs/stacks/setup.mdx +++ b/src/content/docs/stacks/setup.mdx @@ -40,9 +40,19 @@ This installs: - A `pre-push` hook that warns you if you accidentally use `git push` instead of `mergify stack push`. -- A [Claude Code](https://claude.ai/code) skill that teaches the AI - coding agent how to work with Mergify Stacks, so it automatically uses - `mergify stack push` instead of `git push`. +## Claude Code Integration + +If you use [Claude Code](https://claude.ai/code), add the Mergify marketplace +and install the Stacks plugin: + +```bash +/plugin marketplace add mergifyio/mergify-cli +/plugin install mergify-stack +``` + +This teaches Claude Code how to work with Mergify Stacks, so it automatically +uses `mergify stack push` instead of `git push` and follows the stacked PR +workflow. ## Verify It Works diff --git a/src/content/docs/stacks/team.mdx b/src/content/docs/stacks/team.mdx index 365307ecff..cfb7dbe746 100644 --- a/src/content/docs/stacks/team.mdx +++ b/src/content/docs/stacks/team.mdx @@ -41,6 +41,19 @@ to install anything. As more developers see the benefits in review, adoption spreads naturally. +## Working on Someone Else's Stack + +If a teammate has pushed a stack and you want to pick it up locally (to help, +pair, or continue the work), use `checkout` with their branch name: + +```bash +mergify stack checkout --branch feat/their-feature +``` + +This reconstructs the stack locally by fetching the remote branches and +rebuilding the commit chain. You can then make changes and push updates with +`mergify stack push` as usual. + ## When to Use Stacks Not every change needs a stack. Use stacks when the alternative is a large,