Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mnem checkout

Move HEAD to a branch or commit.

Synopsis

mnem checkout [OPTIONS] [REV]

Description

Switches HEAD to REV - a branch name or commit id - and materialises working memory to match. Refuses if there is anything staged and uncommitted, unless --discard says to drop it. -b <NAME> creates a new branch and switches to it in one step, with REV (or HEAD, if omitted) as that branch's start point - the quickest way to fork a hypothesis.

Options

Argument / FlagDescription
[REV]A branch or commit to switch to. With -b, the new branch's start point.
-b, --create <NAME>Create a branch and switch to it.
--discardDrop uncommitted staged changes instead of refusing.

Examples

$ mnem checkout escalation
Switched to branch escalation

Fork and switch in one step:

$ mnem checkout -b feature-b
Switched to branch feature-b

See also

  • branch - create a branch without switching to it.
  • merge - bring a branch's own commits back into the one you switched away from.