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,