Internal formatter. Used by ls-files and friends.
Internal column formatter Git uses to lay out lists like branch, tag, status -s, and ls-files in tidy multi-column blocks. You rarely call it directly, but knowing it explains why those commands suddenly stop columnizing in pipes.
A pure text reformatter: read lines on stdin, emit a column-packed layout on stdout, sized to the terminal width. The 'auto' mode is the default everywhere — it activates only on a TTY, which is why git branch | cat looks single-column.
git column [--command=<name>] [--mode=<mode>] [--raw-mode=<n>]
[--width=<width>] [--indent=<string>] [--nl=<string>]
[--padding=<n>]
Reads lines from stdin and writes a columnar layout to stdout.
--command=<name> lets it consult column.<name> / column.ui config so
callers like 'git branch' get consistent behavior. Most users meet it
indirectly via the column.ui or column.<command> settings.| Flag | What it does |
|---|---|
--mode=<mode> | Layout choice: 'always' (force columns), 'auto' (only on TTY), 'never'/'plain' (one per line), plus 'column' (fill columns first), 'row' (fill rows first), 'dense'/'nodense' (variable vs. fixed column widths). |
--raw-mode=<n> | Set the layout mode by integer bitmask instead of a name. For scripts that already speak Git's internal flag values; prefer --mode for sanity. |
--width=<n> | Override terminal width. Defaults to COLUMNS, then ioctl, then 80. Useful when piping for a known target (e.g., a fixed-width log). |
--indent=<str> | String prepended to each output line. Handy for embedding columnized output under a heading. |
--nl=<str> | String appended to each line in place of a plain newline. Lets you stitch the output into other formats. |
--padding=<n> | Spaces between columns. Default 1; bump it when entries are visually dense. |
git branch to columnize even when redirected, by setting column.branch=always.column.ui=never.ls | git column --mode=densegit ls-files | git column --mode=always --width=120git tag | git column --mode=always --indent=' 'git config --global column.branch alwayscolumn.ui=auto (the default) and override per-command via column.branch, column.tag, column.status only where you have a real preference.--mode=plain or strip columns out of the equation entirely.Hit each option, then Check answers. Score is recorded; Next is always open.