Setup and Config
Getting and Creating Projects
Basic Snapshotting
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
Patching
Debugging
External Systems
Server Admin
Guides
- gitattributes
- Command-line interface conventions
- Everyday Git
- Frequently Asked Questions (FAQ)
- Glossary
- Hooks
- gitignore
- gitmodules
- Revisions
- Submodules
- Tutorial
- Workflows
- All guides...
Administration
Plumbing Commands
- 2.47.1 → 2.48.1 no changes
- 2.47.0 10/06/24
- 2.45.1 → 2.46.3 no changes
- 2.45.0 04/29/24
- 2.44.1 → 2.44.3 no changes
- 2.44.0 02/23/24
- 2.43.1 → 2.43.6 no changes
- 2.43.0 11/20/23
- 2.42.1 → 2.42.4 no changes
- 2.42.0 08/21/23
- 2.41.1 → 2.41.3 no changes
- 2.41.0 06/01/23
- 2.34.1 → 2.40.4 no changes
- 2.34.0 11/15/21
- 2.31.1 → 2.33.8 no changes
- 2.31.0 03/15/21
- 2.29.1 → 2.30.9 no changes
- 2.29.0 10/19/20
- 2.23.1 → 2.28.1 no changes
- 2.23.0 08/16/19
- 2.21.1 → 2.22.5 no changes
- 2.21.0 02/24/19
- 2.19.1 → 2.20.5 no changes
- 2.19.0 09/10/18
- 2.18.1 → 2.18.5 no changes
- 2.18.0 06/21/18
- 2.17.0 → 2.17.6 no changes
- 2.16.6 12/06/19
- 2.15.4 12/06/19
- 2.14.6 12/06/19
- 2.13.7 05/22/18
- 2.12.5 09/22/17
- 2.10.5 → 2.11.4 no changes
- 2.9.5 07/30/17
- 2.8.6 07/30/17
- 2.7.6 07/30/17
- 2.6.7 no changes
- 2.5.6 05/05/17
- 2.1.4 → 2.4.12 no changes
- 2.0.5 12/17/14
SYNOPSIS
git for-each-ref [--count=<count>] [--shell|--perl|--python|--tcl] [(--sort=<key>)…] [--format=<format>] [--include-root-refs] [ --stdin | <pattern>… ] [--points-at=<object>] [--merged[=<object>]] [--no-merged[=<object>]] [--contains[=<object>]] [--no-contains[=<object>]] [--exclude=<pattern> …]
DESCRIPTION
Iterate over all refs that match <pattern>
and show them
according to the given <format>
, after sorting them according
to the given set of <key>
. If <count>
is given, stop after
showing that many refs. The interpolated values in <format>
can optionally be quoted as string literals in the specified
host language allowing their direct evaluation in that language.
OPTIONS
- <pattern>…
-
If one or more patterns are given, only refs are shown that match against at least one pattern, either using fnmatch(3) or literally, in the latter case matching completely or from the beginning up to a slash.
- --stdin
-
If
--stdin
is supplied, then the list of patterns is read from standard input instead of from the argument list. - --count=<count>
-
By default the command shows all refs that match
<pattern>
. This option makes it stop after showing that many refs. - --sort=<key>
-
A field name to sort on. Prefix
-
to sort in descending order of the value. When unspecified,refname
is used. You may use the --sort=<key> option multiple times, in which case the last key becomes the primary key. - --format=<format>
-
A string that interpolates
%(fieldname)
from a ref being shown and the object it points at. In addition, the string literal%%
renders as%
and%xx
- wherexx
are hex digits - renders as the character with hex codexx
. For example,