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.gitdir.absolute`::
117 The canonical absolute path to the Git repository directory (the `.git` directory).
118
119 `path.gitdir.relative`::
120 The path to the Git repository directory relative to the current working directory.
121
122 `references.format`::
123 The reference storage format. The valid values are:
124 +
125 include::ref-storage-format.adoc[]
126
127 EXAMPLES
128 --------
129
130 * Retrieves the reference format of the current repository:
131 +
132 ------------
133 git repo info references.format
134 ------------
135 +
136
137 * Retrieves whether the current repository is bare and whether it is shallow
138 using the `nul` format:
139 +
140 ------------
141 git repo info --format=nul layout.bare layout.shallow
142 ------------
143
144 SEE ALSO
145 --------
146 linkgit:git-rev-parse[1]
147
148 GIT
149 ---
150 Part of the linkgit:git[1] suite