Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

zm.branch

Branches — git branch.

  • zm.branch() lists the branches, the session's marked current; { remotes = true } lists origin's (origin/<name>) and { all = true } both.
  • zm.branch("feature") creates feature at HEAD ({ start = "<rev>" } starts it elsewhere). The session stays where it is; zm.checkout("feature") moves it, bringing your uncommitted changes along.
  • zm.branch("feature", { delete = true }) deletes it. It refuses a branch whose commits the session's branch does not hold, or whose working tree holds uncommitted changes; { delete = true, force = true } deletes it regardless (git branch -D).
  • zm.branch("feature", { rename = "feature-2" }) renames it.

A name starting with - is refused: it is an option in git, never a branch.