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. The path is returned
130 regardless of whether the file currently exists on disk.
131
132 `path.grafts.relative`::
133 The path to the repository grafts file relative to the current working
134 directory. Respects the `GIT_GRAFT_FILE` environment override. The path
135 is returned regardless of whether the file currently exists on disk.
136
137 `path.hooks.absolute`::
138 The canonical absolute path to the repository's hooks directory.
139 Respects `core.hooksPath` configuration adjustments.
140
141 `path.hooks.relative`::
142 The path to the repository's hooks directory relative to the current
143 working directory. Respects `core.hooksPath` configuration adjustments.
144
145 `path.index.absolute`::
146 The canonical absolute path to the repository's current index file.
147 Respects the `GIT_INDEX_FILE` environment override. The returned path
148 reflects the configured/default index location regardless of whether the
149 repository is bare or whether the file currently exists.
150
151 `path.index.relative`::
152 The path to the repository's current index file relative to the current
153 working directory. Respects the `GIT_INDEX_FILE` environment override.
154 The returned path reflects the configured/default index location regardless
155 of whether the repository is bare or whether the file currently exists.
156
157 `path.objects.absolute`::
158 The canonical absolute path to the repository's object database directory.
159 Respects the `GIT_OBJECT_DIRECTORY` environment override.
160
161 `path.objects.relative`::
162 The path to the repository's object database directory relative to the
163 current working directory. Respects the `GIT_OBJECT_DIRECTORY`
164 environment override.
165
166 `path.superproject-working-tree.absolute`::
167 The canonical absolute path to the working tree root of the superproject
168 if the current repository is an initialized submodule. Outputs an empty
169 string if not in a submodule.
170
171 `path.superproject-working-tree.relative`::
172 The path to the working tree root of the superproject relative to the
173 current working directory if the current repository is an initialized
174 submodule. Outputs an empty string if not in a submodule.
175
176 `path.toplevel.absolute`::
177 The canonical absolute path to the top-level directory of the
178 repository's working tree. Outputs an empty string if the repository
179 is bare.
180
181 `path.toplevel.relative`::
182 The path to the top-level directory of the repository's working
183 tree relative to the current working directory. Outputs an empty
184 string if the repository is bare.
185
186 `references.format`::
187 The reference storage format. The valid values are:
188 +
189 include::ref-storage-format.adoc[]
190
191 EXAMPLES
192 --------
193
194 * Retrieves the reference format of the current repository:
195 +
196 ------------
197 git repo info references.format
198 ------------
199 +
200
201 * Retrieves whether the current repository is bare and whether it is shallow
202 using the `nul` format:
203 +
204 ------------
205 git repo info --format=nul layout.bare layout.shallow
206 ------------
207
208 SEE ALSO
209 --------
210 linkgit:git-rev-parse[1]
211
212 GIT
213 ---
214 Part of the linkgit:git[1] suite