Skip to main content

Documentation Index

Fetch the complete documentation index at: https://gx.mubbie.dev/llms.txt

Use this file to discover all available pages before exploring further.

gx parent prints the parent branch of the current branch and exits. It is designed for use in shell scripts and pipelines — it outputs only the branch name with no decoration.

Usage

gx parent

Behavior

  • If the current branch is in the stack, prints the stack parent
  • If the current branch is not in the stack, prints the HEAD branch (main/master)
  • If you are on trunk, exits with code 1 (no output)
  • If not in a git repo, exits with code 1 (no output)

Examples

$ gx parent
feature/auth

Composability

gx parent is designed for shell pipelines and scripting:
$ git diff $(gx parent)...HEAD
gx parent uses exit codes for scripting: exit 0 means a parent was found and printed, exit 1 means no parent (on trunk, detached HEAD, or not in a repo). It never prints error messages to stdout.
  • Output is a single line with just the branch name, no color codes or prefix
  • When the branch is in the stack config, the recorded parent is used
  • When the branch is not in the stack, the HEAD branch is returned as a sensible default
  • On trunk, there is no parent, so the command exits with code 1 and no output