git town ship: Merge a Feature Branch Into Trunk
git town ship merges the current feature branch into trunk, pushes, and deletes the shipped branch.
git town ship is the final step of the git-town workflow: it folds a finished branch into the main branch and cleans up, so the trunk stays tidy.
What it does
git town ship merges the current (or named) feature branch into trunk using the configured ship strategy, pushes trunk, and deletes the local and remote feature branch. Descendant branches are re-parented onto trunk.
Common usage
# ship the current branch with a squash-merge message
git town ship --message "Add feature X"
# ship a named branch
git town ship feature-x --message "Add feature X"Options
| Flag / Config | What it does |
|---|---|
| --message <m> | Commit message for the merge (avoids the editor) |
| [<branch>] | Ship a specific branch instead of the current one |
| --to-parent | Ship into the branch parent instead of trunk |
| git-town.ship-strategy | Config: squash-merge, api, or fast-forward |
| git-town.main-branch | Config: which branch is trunk |
In CI
Pass --message so no editor opens. Ship needs write access to the remote (a token with repo/push scope) and the git-town main branch configured. If your platform enforces PR merges, use the api ship strategy so ship merges through the platform API instead of pushing directly.
Common errors in CI
"cannot ship: this is not a Git repository" means it ran outside a checkout. "the working directory contains uncommitted changes" means you must commit or stash first. "cannot ship the main branch" means you are on trunk, not a feature branch. "the required Git Town configuration is missing" means git-town.main-branch is unset.