831 B
831 B
Merge the current worktree back to the target branch and clean up: $ARGUMENTS
Parse arguments to extract:
- Target branch (required, first argument like 'master' or 'develop')
Execute these steps:
- Check if we're currently in a worktree (not the main repo)
- Get current branch name with
git branch --show-current - Check for uncommitted changes with
git status - If there are uncommitted changes stop process and ask user to commit changes.
- Push the current branch to origin
- Navigate back to the main repository directory
- Switch to the target branch and pull latest changes
- Merge the current branch into the target branch
- Remove the worktree with
git worktree remove <worktree-path> - Ask if I should delete the feature branch locally
Handle any merge conflicts by explaining the resolution process.