feature publish
Publish your work from the @local branch to the public branch. This command uses git cherry to identify commits that are not yet present on the public branch, skips any [MEMORY]-prefixed commits, and cherry-picks the rest in order.
Usage
# If you've already committed on @local
git shadow feature publish
# Commit and publish in one step
git shadow feature publish --commit -m "your commit message"
# Publish and push the public branch to origin in one step
git shadow feature publish --commit -m "your commit message" --push
Full workflow example
# On feature/login@local โ work normally
git add .
git shadow feature publish --commit -m "feat(auth): user login function"
# Then push the public branch normally
git push origin feature/login
What it does
- If
--commitis passed, runsgit shadow commitfirst (strips local comments, creates two commits on@local) - Uses
git cherryto find commits in@localnot yet in the public branch - Skips commits whose message matches
SHADOW_COMMIT_FILTER(default:[MEMORY]prefix) - Cherry-picks the remaining commits onto the public branch in order
- Skips empty cherry-picks (patches already applied) automatically
- Stops with an error on conflict โ resolve it, then run
git cherry-pick --continueorgit cherry-pick --abort - If
--pushis passed, pushes the public branch toorigin - Always switches back to the originating
@localshadow branch when done
Your @local branch retains the full history including local comments. The public branch receives only clean, reviewable commits.
[MEMORY] commits
Commits prefixed with [MEMORY] are never cherry-picked to the public branch. Use them for AI context files, local environment changes, or personal helpers.
git shadow commit -m "[MEMORY] add domain model notes for AI"
The [MEMORY] prefix is configurable via SHADOW_COMMIT_PREFIX.
After publishing
# Push to remote as usual
git push origin feature/login
Your @local branch is blocked from being pushed by the pre-push hook โ it stays local by design.
Related
- commit โ commit only, without publishing
- feature start โ create a new feature with both branches
- feature sync โ rebase shadow branch onto the updated public branch
- feature finish โ clean up after the MR is merged