Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 1.77 KB

ship.md

File metadata and controls

51 lines (38 loc) · 1.77 KB

Ship command

Deliver a completed feature branch

Squash-merges the current branch, or <branch_name> if given, into the main branch, resulting in linear history on the main branch.

  • syncs the main branch
  • pulls remote updates for <branch_name>
  • merges the main branch into <branch_name>
  • squash-merges <branch_name> into the main branch with commit message specified by the user
  • pushes the main branch to the remote repository
  • deletes <branch_name> from the local and remote repositories

Ships direct children of the main branch. To ship a nested child branch, ship or kill all ancestor branches first.

If you use GitHub, this command can squash merge pull requests via the GitHub API. Setup:

  1. Get a GitHub personal access token with the "repo" scope
  2. Run 'git config git-town.github-token XXX' (optionally add the '--global' flag) Now anytime you ship a branch with a pull request on GitHub, it will squash merge via the GitHub API. It will also update the base branch for any pull requests against that branch.

If your origin server deletes shipped branches, for example GitHub's feature to automatically delete head branches, run git config git-town.ship-delete-remote-branch false and Git Town will leave it up to your origin server to delete the remote branch.

Usage

git town ship

Flags

-m, --message string   Specify the commit message for the squash commit