Finish a Feature Branch
By Sage · Published · Updated
Closes out a feature branch safely: confirm tests and base, then choose to merge locally, open a pull request or keep the branch, with no force push.
Prompt template
## Finish a Feature Branch Help me wrap up this feature branch. - Branch name: [text: The feature branch] - Base branch: [text: Where it should land] - Test command: [text: Command that runs the suite] - Team workflow: [dropdown: Pull request required, Direct merge allowed, Not sure] - Preferred ending: [dropdown: Merge locally, Open a pull request, Keep the branch for now] - Delete branch after: [toggle: Yes, No] First run the test command and stop if anything fails; report the failures and do not continue. Then confirm the base branch is right by looking at where the branch diverged, and check the working tree is clean. Show the commit list and diff summary that will land. Follow the preferred ending, adjusted for the team workflow: merging locally means updating the base, merging without rewriting shared history, re-running the tests on the result, and only then pushing; a pull request means pushing the branch and preparing the title and description; keeping means leaving it untouched with a note of what remains. Never force push, never rewrite commits that others may have pulled, and ask before any step that cannot be undone.