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

Git nodes

Git nodes run structured git operations without shell wrappers. Declare an action and optional options; definitively builds the git argv, runs the command, and parses output into signals and data.

Example

nodes:
  repo_status:
    kind: git
    action: status
    outcome:
      success:
        - signal: clean
      partial:
        - signal: dirty

  ship_commit:
    kind: git
    action: commit
    options:
      message: "chore: ship"
      add: all
    outcome:
      success:
        - exit_code: 0
      failure:
        - exit_code: {neq: 0}

Fields

FieldRequiredDescription
kindyesMust be git
actionyesGit operation (see table below)
optionsnoAction-specific parameters
cwdnoWorking directory (default: workspace root)
timeout_msnoSubprocess timeout
outcomeyesOutcome rules — see Outcome rules

Actions

ActionPurposeOptionsSignals / data
statusWorking tree snapshotclean, dirty, ahead, behind
diffShow changesstaged, stathas_changes
addStage filesall: true or paths: [...]exit code
commitCreate commitmessage, add, amend, allow_emptyexit code
pushPush refsremote, branch, tags, set_upstreamexit code
tagCreate tagname, message, annotate, pushexit code

The commit action accepts add: all or add: [paths] to stage before committing in one node.

Prerequisites

  • git on PATH
  • For commit/tag: configure user.name and user.email in the repo

Node catalog

Copy-paste fragments from .definitively/nodes/git.yml (installed via definitively init).

Try it: Add a status node to a program and route partial (dirty) to a commit node.