GitHub Issue Integration
worktree can derive branch names directly from GitHub issues in the current repository.
Basic Usage
worktree branch --github 42
worktree branch --github "#42"The generated branch name is shown as the default in the prompt, so you can accept it or edit it before creation.
How Branch Names Are Built
- Read issue number and title from the GitHub API.
- Sanitize the title into a branch-safe slug.
- Optionally prepend a configured prefix based on issue type.
Supported issue-type prefix mapping:
Feature->branchPrefix.featureBug->branchPrefix.bugfixTask->branchPrefix.chore
If a prefix key is not configured, no prefix is applied.
Authentication Resolution
Authentication is resolved in this order:
- Existing
github.tokenin local git config. gh auth tokenfrom GitHub CLI.- Interactive prompt for a token, then save to local git config.
Suggested Setup
worktree config github.token <token>
worktree config branchPrefix.feature feature/
worktree config branchPrefix.bugfix fix/
worktree config branchPrefix.chore chore/You can also configure only missing values:
worktree config --missing --names github.token,branchPrefix.feature,branchPrefix.bugfix,branchPrefix.choreLast updated on