New-WorkBranch Start a new working area for an isolated task, fix, or doc change.
Description
New-WorkBranch creates a new working area starting from the current point and switches to it. Use it when starting a new feature, a bug fix, or a documentation pass that should not mix with the active working area.
The command refuses to start a new working area when an unfinished merge, rebase, cherry-pick, revert, or bisect is in progress, or when there are unfinished conflicts. It also rejects names that are not valid working-area identifiers (spaces, control characters, leading dashes, and similar) and refuses to overwrite a working area that already exists.
Each invocation writes a self-contained diagnostic log file. Successful runs log silently; failures throw a plain-English message and point at the log file with the technical detail.
Recipes
New-WorkBranch -Name fix-readme
Find-CodeChange; New-WorkBranch -Name docs-refresh
Notes
Safety:
- Refuses to run during an unfinished merge, rebase, cherry-pick, revert, or bisect.
- Refuses to run while there are unfinished conflicts.
- Refuses to overwrite an existing working area.
- Validates the name through git check-ref-format.
Parameters
Was this page helpful? Report an issue or suggest an improvement →