Skip to content

column Git Command Guide

The git column command formats and displays data in multiple columns, making output from other Git commands more readable by organizing it neatly.

Terminal window
git column [<options>] [-- <command>]
OptionDescription
—mode=Select the terminal-wide part of the width to use
—raw-mode=Same as —mode but does not assume terminal width
—padding=Determine padding between columns
—indent=Add string to the beginning of each line
—width=Specify terminal width (overrides autodetection)
—tablePrefix each column with a table-like header
—table-columns=Specify column names for table headers
—columnPrefix each column with column number and header
—column-columns=Specify column names when using —column
—lineSame as —column but without column numbers
—line-columns=Specify column names when using —line
-n, —no-headersDo not print headers
—help, -hDisplay help
ParameterDescription
Command whose output should be formatted
Terminal window
git branch --format='%(refname:short)' | git column --mode=column

Displays Git branches in organized columns.

Terminal window
git branch --format='%(refname:short)%00%(objectname:short)' | git column --table --table-columns='Branch,SHA'

Creates a table format with headers.

Terminal window
git tag --sort=-creatordate | git column --mode=column

Shows tags sorted by creation date in columns.

Terminal window
echo -e "item1\\titem2\\nitem3\\titem4" | git column --padding=3

Shows items with 3 spaces padding between columns.

Terminal window
git for-each-ref --format='%(refname:short)%00%(authorname)%00%(subject)' refs/heads | git column --mode=column --table --table-columns='Branch,Author,Subject'

Creates a table showing branches with author and subject.

To display Git branches in columns, use:

Terminal window
git branch | git column --mode=column

To create a table with git column, execute:

Terminal window
<command> | git column --table --table-columns='<headers>'

To adjust column padding, run:

Terminal window
<command> | git column --padding=<number>

To format output without headers, use:

Terminal window
<command> | git column --no-headers

How do I use git column with for-each-ref?

Section titled “How do I use git column with for-each-ref?”

To use git column with for-each-ref, run:

Terminal window
git for-each-ref --format='...' | git column --mode=column
  1. Formatting branch lists for better readability in terminals
  2. Creating table-like displays of repository references
  3. Organizing output from commands like git tag and git branch
  4. Presenting structured data in CI/CD pipeline outputs
  5. Enhancing visual organization of Git command results
  6. Supporting scripts that need formatted columnar display