Deliver a completed feature branchSquash-merges the current branch, or 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
Only shipping of direct children of the main branch is allowed. To ship a nested child branch, all ancestor branches have to be shipped or killed.
If you are using GitHub, this command can squash merge pull requests via the GitHub API. Setup:
- Get a GitHub personal access token with the "repo" scope
- 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.
git town ship
-m, --message string Specify the commit message for the squash commit