Raw
1 git-repo(1)
2 ===========
3
4 NAME
5 ----
6 git-repo - Retrieve information about the repository
7
8 SYNOPSIS
9 --------
10 [synopsis]
11 git repo info [--format=(lines|nul) | -z] [--all | <key>...]
12 git repo info --keys [--format=(lines|nul) | -z]
13 git repo structure [--format=(table|lines|nul) | -z]
14
15 DESCRIPTION
16 -----------
17 Retrieve information about the repository.
18
19 THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
20
21 COMMANDS
22 --------
23 `info [--format=(lines|nul) | -z] [--all | <key>...]`::
24 Retrieve metadata-related information about the current repository. Only
25 the requested data will be returned based on their keys (see "INFO KEYS"
26 section below).
27 +
28 The values are returned in the same order in which their respective keys were
29 requested. The `--all` flag requests the values for all the available keys.
30 +
31 The output format can be chosen through the flag `--format`. Two formats are
32 supported:
33 +
34
35 `lines`:::
36 Output key-value pairs one per line using the `=` character as
37 the delimiter between the key and the value. Values containing "unusual"
38 characters are quoted as explained for the configuration variable
39 `core.quotePath` (see linkgit:git-config[1]). This is the default.
40
41 `nul`:::
42 Similar to `lines`, but using a newline character as the delimiter
43 between the key and the value and using a _NUL_ character after each value.
44 This format is better suited for being parsed by another applications than
45 `lines`. Unlike in the `lines` format, the values are never quoted.
46 +
47 `-z` is an alias for `--format=nul`.
48
49 `info --keys [--format=(lines|nul) | -z]`::
50 List all the available keys, one per line. The output format can be chosen
51 through the flag `--format`. The following formats are supported:
52 +
53 `lines`:::
54 Output the keys one per line. This is the default.
55
56 `nul`:::
57 Similar to `lines`, but using a _NUL_ character after each value.
58
59 `structure [--format=(table|lines|nul) | -z]`::
60 Retrieve statistics about the current repository structure. The
61 following kinds of information are reported:
62 +
63 * Reference counts categorized by type
64 * Reachable object counts categorized by type
65 * Total inflated size of reachable objects by type
66 * Total disk size of reachable objects by type
67 * Largest reachable objects in the repository by type
68 +
69 The output format can be chosen through the flag `--format`. Three formats are
70 supported:
71 +
72 `table`:::
73 Outputs repository stats in a human-friendly table. This format may
74 change and is not intended for machine parsing. This is the default
75 format.
76
77 `lines`:::
78 Each line of output contains a key-value pair for a repository stat.
79 The '=' character is used to delimit between the key and the value.
80 Values containing "unusual" characters are quoted as explained for the
81 configuration variable `core.quotePath` (see linkgit:git-config[1]).
82
83 `nul`:::
84 Similar to `lines`, but uses a _NUL_ character to delimit between
85 key-value pairs instead of a newline. Also uses a newline character as
86 the delimiter between the key and value instead of '='. Unlike the
87 `lines` format, values containing "unusual" characters are never
88 quoted.
89 +
90 `-z` is an alias for `--format=nul`.
91
92 INFO KEYS
93 ---------
94 In order to obtain a set of values from `git repo info`, you should provide
95 the keys that identify them. Here's a list of the available keys and the
96 values that they return:
97
98 `layout.bare`::
99 `true` if this is a bare repository, otherwise `false`.
100
101 `layout.shallow`::
102 `true` if this is a shallow repository, otherwise `false`.
103
104 `object.format`::
105 The object format (hash algorithm) used in the repository.
106
107 `path.commondir.absolute`::
108 The canonical absolute path to the Git repository's common
109 directory (the shared `.git` directory containing objects,
110 refs, and global configuration).
111
112 `path.commondir.relative`::
113 The path to the Git repository's common directory relative to
114 the current working directory.
115
116 `path.git-prefix`::
117 The relative path from the top-level directory of the working tree to
118 the current working directory (including a trailing slash). Outputs an
119 empty string if executed at the root of the working tree.
120
121 `path.gitdir.absolute`::
122 The canonical absolute path to the Git repository directory (the `.git` directory).
123
124 `path.gitdir.relative`::
125 The path to the Git repository directory relative to the current working directory.
126
127 `path.grafts.absolute`::
128 The canonical absolute path to the repository grafts file.
129 Respects the `GIT_GRAFT_FILE` environment override.
130
131 `path.grafts.relative`::
132 The path to the repository grafts file relative to the current working
133 directory. Respects the `GIT_GRAFT_FILE` environment override.
134
135 `path.hooks.absolute`::
136 The canonical absolute path to the repository's hooks directory.
137 Respects `core.hooksPath` configuration adjustments.
138
139 `path.hooks.relative`::
140 The path to the repository's hooks directory relative to the current
141 working directory. Respects `core.hooksPath` configuration adjustments.
142
143 `path.index.absolute`::
144 The canonical absolute path to the repository's current index file.
145 Respects the `GIT_INDEX_FILE` environment override.
146
147 `path.index.relative`::
148 The path to the repository's current index file relative to the current
149 working directory. Respects the `GIT_INDEX_FILE` environment override.
150
151 `path.objects.absolute`::
152 The canonical absolute path to the repository's object database directory.
153 Respects the `GIT_OBJECT_DIRECTORY` environment override.
154
155 `path.objects.relative`::
156 The path to the repository's object database directory relative to the
157 current working directory. Respects the `GIT_OBJECT_DIRECTORY`
158 environment override.
159
160 `path.superproject-working-tree.absolute`::
161 The canonical absolute path to the working tree root of the superproject
162 if the current repository is an initialized submodule. Outputs an empty
163 string if not in a submodule.
164
165 `path.superproject-working-tree.relative`::
166 The path to the working tree root of the superproject relative to the
167 current working directory if the current repository is an initialized
168 submodule. Outputs an empty string if not in a submodule.
169
170 `path.toplevel.absolute`::
171 The canonical absolute path to the top-level directory of the
172 repository's working tree. Outputs an empty string if the repository
173 is bare.
174
175 `path.toplevel.relative`::
176 The path to the top-level directory of the repository's working
177 tree relative to the current working directory. Outputs an empty
178 string if the repository is bare.
179
180 `references.format`::
181 The reference storage format. The valid values are:
182 +
183 include::ref-storage-format.adoc[]
184
185 EXAMPLES
186 --------
187
188 * Retrieves the reference format of the current repository:
189 +
190 ------------
191 git repo info references.format
192 ------------
193 +
194
195 * Retrieves whether the current repository is bare and whether it is shallow
196 using the `nul` format:
197 +
198 ------------
199 git repo info --format=nul layout.bare layout.shallow
200 ------------
201
202 SEE ALSO
203 --------
204 linkgit:git-rev-parse[1]
205
206 GIT
207 ---
208 Part of the linkgit:git[1] suite