Home Explore Blog CI



git

3rd chunk of `Documentation/git-for-each-ref.adoc`
2fa027c4c87f4b9955e8361cd6964c74e45174417ee8390c0000000100000fa6
 `%(upstream)`, `%(upstream:remotename)`
and `%(upstream:remoteref)` refer to the name of the remote and the
name of the tracked remote ref, respectively. In other words, the
remote-tracking branch can be updated explicitly and individually by
using the refspec `%(upstream:remoteref):%(upstream)` to fetch from
`%(upstream:remotename)`.
+
Has no effect if the ref does not have tracking information associated
with it.  All the options apart from `nobracket` are mutually exclusive,
but if used together the last option is selected.

push::
	The name of a local ref which represents the `@{push}`
	location for the displayed ref. Respects `:short`, `:lstrip`,
	`:rstrip`, `:track`, `:trackshort`, `:remotename`, and `:remoteref`
	options as `upstream` does. Produces an empty string if no `@{push}`
	ref is configured.

HEAD::
	'*' if HEAD matches current ref (the checked out branch), ' '
	otherwise.

color::
	Change output color. Followed by `:<colorname>`, where color
	names are described under Values in the "CONFIGURATION FILE"
	section of linkgit:git-config[1].  For example,
	`%(color:bold red)`.

align::
	Left-, middle-, or right-align the content between
	%(align:...) and %(end). The "align:" is followed by
	`width=<width>` and `position=<position>` in any order
	separated by a comma, where the `<position>` is either left,
	right or middle, default being left and `<width>` is the total
	length of the content with alignment. For brevity, the
	"width=" and/or "position=" prefixes may be omitted, and bare
	<width> and <position> used instead.  For instance,
	`%(align:<width>,<position>)`. If the contents length is more
	than the width then no alignment is performed. If used with
	`--quote` everything in between %(align:...) and %(end) is
	quoted, but if nested then only the topmost level performs
	quoting.

if::
	Used as %(if)...%(then)...%(end) or
	%(if)...%(then)...%(else)...%(end).  If there is an atom with
	value or string literal after the %(if) then everything after
	the %(then) is printed, else if the %(else) atom is used, then
	everything after %(else) is printed. We ignore space when
	evaluating the string before %(then), this is useful when we
	use the %(HEAD) atom which prints either "*" or " " and we
	want to apply the 'if' condition only on the 'HEAD' ref.
	Append ":equals=<string>" or ":notequals=<string>" to compare
	the value between the %(if:...) and %(then) atoms with the
	given string.

symref::
	The ref which the given symbolic ref refers to. If not a
	symbolic ref, nothing is printed. Respects the `:short`,
	`:lstrip` and `:rstrip` options in the same way as `refname`
	above.

signature::
	The GPG signature of a commit.

signature:grade::
	Show "G" for a good (valid) signature, "B" for a bad
	signature, "U" for a good signature with unknown validity, "X"
	for a good signature that has expired, "Y" for a good
	signature made by an expired key, "R" for a good signature
	made by a revoked key, "E" if the signature cannot be
	checked (e.g. missing key) and "N" for no signature.

signature:signer::
	The signer of the GPG signature of a commit.

signature:key::
	The key of the GPG signature of a commit.

signature:fingerprint::
	The fingerprint of the GPG signature of a commit.

signature:primarykeyfingerprint::
	The primary key fingerprint of the GPG signature of a commit.

signature:trustlevel::
	The trust level of the GPG signature of a commit. Possible
	outputs are `ultimate`, `fully`, `marginal`, `never` and `undefined`.

worktreepath::
	The absolute path to the worktree in which the ref is checked
	out, if it is checked out in any linked worktree. Empty string
	otherwise.

ahead-behind:<committish>::
	Two integers, separated by a space, demonstrating the number of
	commits ahead and behind, respectively, when comparing the output
	ref to the `<committish>` specified in the format.

is-base:<committish>::
	In at most one row, `(<committish>)` will appear to indicate the ref
	that is most likely the ref used as a starting

Title: Git Ref Formatting Options
Summary
The git command provides various formatting options to customize the output, including options for tracking information, push locations, color changes, alignment, conditional statements, and more. Additional options are available to display specific information such as ref names, symbolic refs, GPG signatures, and worktree paths, allowing for flexible and detailed output.