Skip to main content

Module new

Module new 

Source
Expand description

gw new command - Create a new branch with a structurally unambiguous base.

Three invariants make accidental mistakes unrepresentable:

  1. No ambiguous base. A base is auto-chosen only where exactly one makes sense: the home branch (→ origin/main). From any other branch the base is ambiguous (sibling vs stack), so gw new refuses and demands --stack (base on the current branch) or returning home first.
  2. No implicit merge. When the working tree is dirty, the start point is the current HEAD, so creating the branch never performs a working-tree merge and therefore can never conflict or fail cryptically.
  3. No silent displacement. Uncommitted work only ever travels onto a branch whose base the user explicitly established, and it is always reported.

Functions§

run
Execute the new command