gerritcodereview/gerrit-mcp-server/gerrit-workflow
Claude Code and agent skill by gerritcodereview/gerrit-mcp-server
- community
Checking that the SKILL.md file is still in the repository.
This skill should be used when the user asks to "submit a change to Gerrit", "push for review", "upload a patch", "update a change in Gerrit", "add a patch set", "work with Gerrit", "push to refs/for", "fix a missing Change-Id", "amend a Gerrit change", or any task involving git operations in a repository hosted on Gerrit Code Review. Also use when the user encounters Gerrit push errors such as "missing Change-Id in commit message footer" or "prohibited by Gerrit".
Install
npx vskill@latest install gerritcodereview/gerrit-mcp-server/gerrit-workflowSKILL.md
The same SKILL.md was published earlier as gerritcodereview/gerrit-mcp-server/gerrit-workflow.
Gerrit Workflow
Gerrit is a code review system that sits in front of a git repository. The key difference from GitHub/GitLab: changes go through a review queue before landing in the branch. This changes several git workflows in important ways.
Core Concepts
Changes and Patch Sets
A Change is the unit of review in Gerrit — it corresponds to one logical commit. Each change has:
- A numeric Change number (e.g.,
12345) - A Change-Id trailer in the commit message (e.g.,
Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b)
When a commit is revised and re-uploaded, the new version becomes a new patch set on the same change. Gerrit associates them via the Change-Id trailer — this is what makes the Change-Id essential.
The Magic refs/for/<branch> Ref
Gerrit intercepts pushes to refs/for/<branch>. These pushes never actually create that ref; instead Gerrit creates or updates a Change for review. To land code in master:
The commit-msg Hook
Gerrit provides a commit-msg hook that auto-inserts Change-Id trailers. Without it, the Change-Id must be added manually. To install:
Check if it is already installed:
Common Workflows
1. Create a New Change
The server prints the URL of the new change.
2. Update an Existing Change (New Patch Set)
After receiving review feedback, amend the commit. Do not modify or remove the `Change-Id` line — Gerrit uses it to associate the new commit with the existing change.
3. Work on Multiple Independent Changes
Each change should be its own commit on its own local branch:
Do not stack unrelated changes on a single branch unless they are intentionally dependent (see below).
4. Dependent / Stacked Changes
Gerrit supports chains of dependent changes. Push multiple commits in one push; Gerrit creates one change per commit, linked in a relation chain:
Each change can be reviewed and submitted independently, but Gerrit shows the dependency chain.
5. Rebase and Re-push
When the target branch has moved on, rebase and re-push. Keep Change-Ids intact:
6. Squashing Commits Before Push
When squashing several commits, keep exactly one Change-Id — prefer the one already known to Gerrit (i.e., the one that was previously pushed, if any). Remove the others:
7. Cherry-pick to Another Branch
To propose the same fix on a maintenance branch, cherry-pick and generate a new Change-Id (delete the old one so the hook creates a fresh one):
Or, keep the original Change-Id to have Gerrit treat it as a replacement for the same change on that branch.
Push Options
Additional metadata can be sent with the push via % options or -o:
Fetching Changes
To check out an existing change locally (e.g., to test it):
Common Errors and Fixes
missing Change-Id in commit message footer
The commit has no Change-Id. Fix:
! [remote rejected] ... (prohibited by Gerrit)
Direct push to refs/heads/* was rejected. Push to refs/for/<branch> instead.
Change xxx: patch set already exists
The commit hash hasn't changed since the last push (no new patch set was made). Amend the commit to create a distinct object, then push again.
! [remote rejected] ... (no new changes)
All commits being pushed are already known to Gerrit. This often means the branch is already up to date with the target.
Critical Rules
- Never push directly to `refs/heads/*` unless intentionally bypassing
review (requires special permissions).
- Never change or remove the `Change-Id` trailer when amending a commit that
is already under review — doing so creates a second, orphaned change.
- One logical change = one commit. Gerrit reviews commits, not branches.
- Always verify `Change-Id` is present with
git log -1before pushing. - Keep Change-Ids when rebasing — git preserves them through rebase
automatically.
Additional Resources
- `references/gerrit-vs-github.md` — Side-by-side comparison of Gerrit and
GitHub/GitLab workflows for common tasks
- `references/change-id-details.md` — Deep dive on Change-Id: creation,
squashing, cherry-picks, and edge cases
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/gerrit-workflow/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/gerritcodereview/gerrit-mcp-server/gerrit-workflow)