Skip to content

Instantly share code, notes, and snippets.

@xero
Created October 1, 2012 19:59
Show Gist options
  • Save xero/3814073 to your computer and use it in GitHub Desktop.
Save xero/3814073 to your computer and use it in GitHub Desktop.
git pretty format options
git pretty format options
-------------------------
- '%x20': space
- '%H': commit hash
- '%h': abbreviated commit hash
- '%T': tree hash
- '%t': abbreviated tree hash
- '%P': parent hashes
- '%p': abbreviated parent hashes
- '%an': author name
- '%aN': author name
- '%ae': author email
- '%aE': author email
- '%ad': author date (format respects --date= option)
- '%aD': author date, RFC2822 style
- '%ar': author date, relative
- '%at': author date, UNIX timestamp
- '%ai': author date, ISO 8601 format
- '%cn': committer name
- '%cN': committer name
- '%ce': committer email
- '%cE': committer email
- '%cd': committer date
- '%cD': committer date, RFC2822 style
- '%cr': committer date, relative
- '%ct': committer date, UNIX timestamp
- '%ci': committer date, ISO 8601 format
- '%d': ref names, like the --decorate option
- '%e': encoding
- '%s': subject
- '%f': sanitized subject line, suitable for a filename
- '%b': body
- '%B': raw body (unwrapped subject and body)
- '%N': commit notes
- '%gD': reflog selector, e.g., `refs/stash@\{1\}`
- '%gd': shortened reflog selector, e.g., `stash@\{1\}`
- '%gs': reflog subject
- '%Cred': switch color to red
- '%Cgreen': switch color to green
- '%Cblue': switch color to blue
- '%Creset': reset color
- '%C(...)': color specification, as described in color.branch.* config option
- '%m': left, right or boundary mark
- '%n': newline
- '%%': a raw '%'
- '%x00': print a byte from a hex code
- '%w([<w>[,<i1>[,<i2>]]])': switch line wrapping, like the -w option of shortlog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment