Log inGet started
Package

zm.toolbox

Newest version

This package holds more than this page lists. See all of its files in its world.

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.