Christian Couder | 9e1f0a8 | 2008-06-06 09:07:32 +0200 | [diff] [blame] | 1 | git(1) |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 2 | ====== |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git - the stupid content tracker |
| 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Jonas Fonseca | 8b70004 | 2006-08-25 03:05:48 +0200 | [diff] [blame] | 11 | [verse] |
Nazri Ramliy | 44e1e4d | 2013-09-09 21:47:43 +0800 | [diff] [blame] | 12 | 'git' [--version] [--help] [-C <path>] [-c <name>=<value>] |
Zbigniew Jędrzejewski-Szmek | 68e4b55 | 2012-02-15 00:54:21 +0100 | [diff] [blame] | 13 | [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] |
Johannes Sixt | 7213c28 | 2018-05-03 19:15:08 +0200 | [diff] [blame] | 14 | [-p|--paginate|-P|--no-pager] [--no-replace-objects] [--bare] |
Josh Triplett | d49483f | 2011-07-08 16:14:10 -0700 | [diff] [blame] | 15 | [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] |
Brandon Williams | 74866d7 | 2016-10-07 11:18:48 -0700 | [diff] [blame] | 16 | [--super-prefix=<path>] |
Zbigniew Jędrzejewski-Szmek | 68e4b55 | 2012-02-15 00:54:21 +0100 | [diff] [blame] | 17 | <command> [<args>] |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 18 | |
| 19 | DESCRIPTION |
| 20 | ----------- |
J. Bruce Fields | 23091e9 | 2006-04-02 17:54:34 -0400 | [diff] [blame] | 21 | Git is a fast, scalable, distributed revision control system with an |
| 22 | unusually rich command set that provides both high-level operations |
| 23 | and full access to internals. |
| 24 | |
Jonathan Nieder | 6998e4d | 2008-06-30 17:01:21 -0500 | [diff] [blame] | 25 | See linkgit:gittutorial[7] to get started, then see |
Philip Oakley | 673151a | 2014-10-10 22:25:37 +0100 | [diff] [blame] | 26 | linkgit:giteveryday[7] for a useful minimum set of |
Junio C Hamano | 7687ae9 | 2012-08-17 12:48:52 -0700 | [diff] [blame] | 27 | commands. The link:user-manual.html[Git User's Manual] has a more |
| 28 | in-depth introduction. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 29 | |
Junio C Hamano | 7687ae9 | 2012-08-17 12:48:52 -0700 | [diff] [blame] | 30 | After you mastered the basic concepts, you can come back to this |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 31 | page to learn what commands Git offers. You can learn more about |
| 32 | individual Git commands with "git help command". linkgit:gitcli[7] |
Jason St. John | 06ab60c | 2014-05-21 14:52:26 -0400 | [diff] [blame] | 33 | manual page gives you an overview of the command-line command syntax. |
Petr Baudis | 4514ad4 | 2006-06-07 20:43:50 +0200 | [diff] [blame] | 34 | |
Jonathan Nieder | f793582 | 2016-06-22 10:38:25 -0700 | [diff] [blame] | 35 | A formatted and hyperlinked copy of the latest Git documentation |
| 36 | can be viewed at `https://git.github.io/htmldocs/git.html`. |
Jari Aalto | 34b604a | 2007-04-30 14:21:38 +0300 | [diff] [blame] | 37 | |
Junio C Hamano | 26cfcfb | 2007-02-13 15:15:05 -0800 | [diff] [blame] | 38 | |
Andreas Ericsson | cb22bc4 | 2005-11-16 00:31:25 +0100 | [diff] [blame] | 39 | OPTIONS |
| 40 | ------- |
| 41 | --version:: |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 42 | Prints the Git suite version that the 'git' program came from. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 43 | |
Andreas Ericsson | cb22bc4 | 2005-11-16 00:31:25 +0100 | [diff] [blame] | 44 | --help:: |
Fredrik Kuivinen | a87cd02 | 2006-03-09 17:24:19 +0100 | [diff] [blame] | 45 | Prints the synopsis and a list of the most commonly used |
Matthieu Moy | bcf9626 | 2016-06-28 13:40:11 +0200 | [diff] [blame] | 46 | commands. If the option `--all` or `-a` is given then all |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 47 | available commands are printed. If a Git command is named this |
Christian Couder | 0f6f195 | 2007-12-04 06:44:29 +0100 | [diff] [blame] | 48 | option will bring up the manual page for that command. |
Christian Couder | 45533d2 | 2007-12-04 06:44:29 +0100 | [diff] [blame] | 49 | + |
| 50 | Other options are available to control how the manual page is |
Dan McGee | 5162e69 | 2007-12-29 00:20:38 -0600 | [diff] [blame] | 51 | displayed. See linkgit:git-help[1] for more information, |
Jonathan Nieder | db5d666 | 2008-07-03 01:06:23 -0500 | [diff] [blame] | 52 | because `git --help ...` is converted internally into `git |
| 53 | help ...`. |
Andreas Ericsson | cb22bc4 | 2005-11-16 00:31:25 +0100 | [diff] [blame] | 54 | |
Nazri Ramliy | 44e1e4d | 2013-09-09 21:47:43 +0800 | [diff] [blame] | 55 | -C <path>:: |
| 56 | Run as if git was started in '<path>' instead of the current working |
| 57 | directory. When multiple `-C` options are given, each subsequent |
| 58 | non-absolute `-C <path>` is interpreted relative to the preceding `-C |
| 59 | <path>`. |
| 60 | + |
| 61 | This option affects options that expect path name like `--git-dir` and |
| 62 | `--work-tree` in that their interpretations of the path names would be |
| 63 | made relative to the working directory caused by the `-C` option. For |
| 64 | example the following invocations are equivalent: |
| 65 | |
| 66 | git --git-dir=a.git --work-tree=b -C c status |
| 67 | git --git-dir=c/a.git --work-tree=c/b status |
| 68 | |
Alex Riesen | 8b1fa77 | 2010-03-26 23:53:57 +0100 | [diff] [blame] | 69 | -c <name>=<value>:: |
| 70 | Pass a configuration parameter to the command. The value |
| 71 | given will override values from configuration files. |
| 72 | The <name> is expected in the same format as listed by |
| 73 | 'git config' (subkeys separated by dots). |
Junio C Hamano | a789ca7 | 2014-08-04 15:40:19 -0700 | [diff] [blame] | 74 | + |
| 75 | Note that omitting the `=` in `git -c foo.bar ...` is allowed and sets |
| 76 | `foo.bar` to the boolean true value (just like `[foo]bar` would in a |
| 77 | config file). Including the equals but with an empty value (like `git -c |
Adam Dinwoodie | 5e63332 | 2017-09-28 15:06:48 +0100 | [diff] [blame] | 78 | foo.bar= ...`) sets `foo.bar` to the empty string which `git config |
Andreas Heiduk | 7f0a02b | 2017-08-15 00:12:18 +0200 | [diff] [blame] | 79 | --bool` will convert to `false`. |
Alex Riesen | 8b1fa77 | 2010-03-26 23:53:57 +0100 | [diff] [blame] | 80 | |
Štěpán Němec | 62b4698 | 2010-10-08 19:31:15 +0200 | [diff] [blame] | 81 | --exec-path[=<path>]:: |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 82 | Path to wherever your core Git programs are installed. |
Andreas Ericsson | cb22bc4 | 2005-11-16 00:31:25 +0100 | [diff] [blame] | 83 | This can also be controlled by setting the GIT_EXEC_PATH |
Jonathan Nieder | 56992f7 | 2008-07-03 00:08:12 -0500 | [diff] [blame] | 84 | environment variable. If no path is given, 'git' will print |
Andreas Ericsson | cb22bc4 | 2005-11-16 00:31:25 +0100 | [diff] [blame] | 85 | the current setting and then exit. |
| 86 | |
Markus Heidelberg | 89a56bf | 2009-04-05 04:15:16 +0200 | [diff] [blame] | 87 | --html-path:: |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 88 | Print the path, without trailing slash, where Git's HTML |
Jonathan Nieder | 239b5ed | 2011-05-02 01:07:45 -0500 | [diff] [blame] | 89 | documentation is installed and exit. |
Markus Heidelberg | 89a56bf | 2009-04-05 04:15:16 +0200 | [diff] [blame] | 90 | |
Jon Seymour | f2dd8c3 | 2011-05-01 18:16:25 +1000 | [diff] [blame] | 91 | --man-path:: |
Jonathan Nieder | 239b5ed | 2011-05-02 01:07:45 -0500 | [diff] [blame] | 92 | Print the manpath (see `man(1)`) for the man pages for |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 93 | this version of Git and exit. |
Jon Seymour | f2dd8c3 | 2011-05-01 18:16:25 +1000 | [diff] [blame] | 94 | |
| 95 | --info-path:: |
Jonathan Nieder | 239b5ed | 2011-05-02 01:07:45 -0500 | [diff] [blame] | 96 | Print the path where the Info files documenting this |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 97 | version of Git are installed and exit. |
Johannes Schindelin | 6acbcb9 | 2006-07-25 20:24:22 +0200 | [diff] [blame] | 98 | |
Matthieu Moy | 463a849 | 2007-08-19 19:24:36 +0200 | [diff] [blame] | 99 | -p:: |
| 100 | --paginate:: |
Jonathan Nieder | 06300d9 | 2010-02-14 06:02:35 -0600 | [diff] [blame] | 101 | Pipe all output into 'less' (or if set, $PAGER) if standard |
| 102 | output is a terminal. This overrides the `pager.<cmd>` |
| 103 | configuration options (see the "Configuration Mechanism" section |
| 104 | below). |
Johannes Schindelin | 6acbcb9 | 2006-07-25 20:24:22 +0200 | [diff] [blame] | 105 | |
Johannes Sixt | 7213c28 | 2018-05-03 19:15:08 +0200 | [diff] [blame] | 106 | -P:: |
Matthieu Moy | 463a849 | 2007-08-19 19:24:36 +0200 | [diff] [blame] | 107 | --no-pager:: |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 108 | Do not pipe Git output into a pager. |
Matthieu Moy | 463a849 | 2007-08-19 19:24:36 +0200 | [diff] [blame] | 109 | |
Johannes Schindelin | 6acbcb9 | 2006-07-25 20:24:22 +0200 | [diff] [blame] | 110 | --git-dir=<path>:: |
| 111 | Set the path to the repository. This can also be controlled by |
Tom Russello | 47d81b5 | 2016-06-08 00:35:07 +0200 | [diff] [blame] | 112 | setting the `GIT_DIR` environment variable. It can be an absolute |
Liu Yubao | 302cc11 | 2008-04-29 04:09:20 +0800 | [diff] [blame] | 113 | path or relative path to current working directory. |
Johannes Schindelin | 6acbcb9 | 2006-07-25 20:24:22 +0200 | [diff] [blame] | 114 | |
Matthias Lederhofer | 892c41b | 2007-06-06 09:10:42 +0200 | [diff] [blame] | 115 | --work-tree=<path>:: |
Junio C Hamano | ea472c1 | 2011-01-23 15:49:41 -0800 | [diff] [blame] | 116 | Set the path to the working tree. It can be an absolute path |
| 117 | or a path relative to the current working directory. |
Matthias Lederhofer | 892c41b | 2007-06-06 09:10:42 +0200 | [diff] [blame] | 118 | This can also be controlled by setting the GIT_WORK_TREE |
| 119 | environment variable and the core.worktree configuration |
Junio C Hamano | ea472c1 | 2011-01-23 15:49:41 -0800 | [diff] [blame] | 120 | variable (see core.worktree in linkgit:git-config[1] for a |
| 121 | more detailed discussion). |
Matthias Lederhofer | 892c41b | 2007-06-06 09:10:42 +0200 | [diff] [blame] | 122 | |
Josh Triplett | d49483f | 2011-07-08 16:14:10 -0700 | [diff] [blame] | 123 | --namespace=<path>:: |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 124 | Set the Git namespace. See linkgit:gitnamespaces[7] for more |
Josh Triplett | d49483f | 2011-07-08 16:14:10 -0700 | [diff] [blame] | 125 | details. Equivalent to setting the `GIT_NAMESPACE` environment |
| 126 | variable. |
| 127 | |
Brandon Williams | 74866d7 | 2016-10-07 11:18:48 -0700 | [diff] [blame] | 128 | --super-prefix=<path>:: |
| 129 | Currently for internal use only. Set a prefix which gives a path from |
| 130 | above a repository down to its root. One use is to give submodules |
| 131 | context about the superproject that invoked it. |
| 132 | |
Johannes Schindelin | 6acbcb9 | 2006-07-25 20:24:22 +0200 | [diff] [blame] | 133 | --bare:: |
Junio C Hamano | 9277d60 | 2007-08-27 22:41:23 -0700 | [diff] [blame] | 134 | Treat the repository as a bare repository. If GIT_DIR |
| 135 | environment is not set, it is set to the current working |
| 136 | directory. |
| 137 | |
Christian Couder | b0fa7ab | 2009-10-12 22:30:32 +0200 | [diff] [blame] | 138 | --no-replace-objects:: |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 139 | Do not use replacement refs to replace Git objects. See |
Christian Couder | b0fa7ab | 2009-10-12 22:30:32 +0200 | [diff] [blame] | 140 | linkgit:git-replace[1] for more information. |
| 141 | |
Jeff King | 823ab40 | 2012-12-19 17:37:30 -0500 | [diff] [blame] | 142 | --literal-pathspecs:: |
Nguyễn Thái Ngọc Duy | a16bf9d | 2013-07-14 15:36:07 +0700 | [diff] [blame] | 143 | Treat pathspecs literally (i.e. no globbing, no pathspec magic). |
| 144 | This is equivalent to setting the `GIT_LITERAL_PATHSPECS` environment |
Jeff King | 823ab40 | 2012-12-19 17:37:30 -0500 | [diff] [blame] | 145 | variable to `1`. |
| 146 | |
Steffen Prohaska | 6fb0216 | 2013-09-23 20:54:35 +0200 | [diff] [blame] | 147 | --glob-pathspecs:: |
Nguyễn Thái Ngọc Duy | bd30c2e | 2013-07-14 15:36:08 +0700 | [diff] [blame] | 148 | Add "glob" magic to all pathspec. This is equivalent to setting |
| 149 | the `GIT_GLOB_PATHSPECS` environment variable to `1`. Disabling |
| 150 | globbing on individual pathspecs can be done using pathspec |
| 151 | magic ":(literal)" |
| 152 | |
Steffen Prohaska | 6fb0216 | 2013-09-23 20:54:35 +0200 | [diff] [blame] | 153 | --noglob-pathspecs:: |
Nguyễn Thái Ngọc Duy | bd30c2e | 2013-07-14 15:36:08 +0700 | [diff] [blame] | 154 | Add "literal" magic to all pathspec. This is equivalent to setting |
| 155 | the `GIT_NOGLOB_PATHSPECS` environment variable to `1`. Enabling |
| 156 | globbing on individual pathspecs can be done using pathspec |
| 157 | magic ":(glob)" |
Junio C Hamano | 0d6a873 | 2005-08-23 21:18:49 -0700 | [diff] [blame] | 158 | |
Steffen Prohaska | 6fb0216 | 2013-09-23 20:54:35 +0200 | [diff] [blame] | 159 | --icase-pathspecs:: |
Nguyễn Thái Ngọc Duy | 93d9353 | 2013-07-14 15:36:09 +0700 | [diff] [blame] | 160 | Add "icase" magic to all pathspec. This is equivalent to setting |
| 161 | the `GIT_ICASE_PATHSPECS` environment variable to `1`. |
David Greaves | 6c84e2e | 2005-05-22 18:44:16 +0100 | [diff] [blame] | 162 | |
Jeff King | 27344d6 | 2017-09-27 02:54:30 -0400 | [diff] [blame] | 163 | --no-optional-locks:: |
| 164 | Do not perform optional operations that require locks. This is |
| 165 | equivalent to setting the `GIT_OPTIONAL_LOCKS` to `0`. |
| 166 | |
Nguyễn Thái Ngọc Duy | 0089521 | 2018-05-20 20:39:57 +0200 | [diff] [blame] | 167 | --list-cmds=group[,group...]:: |
| 168 | List commands by group. This is an internal/experimental |
| 169 | option and may change or be removed in the future. Supported |
| 170 | groups are: builtins, parseopt (builtin commands that use |
Nguyễn Thái Ngọc Duy | 6bb2dc0 | 2018-05-20 20:39:59 +0200 | [diff] [blame] | 171 | parse-options), main (all commands in libexec directory), |
Nguyễn Thái Ngọc Duy | 3c77776 | 2018-05-20 20:40:00 +0200 | [diff] [blame] | 172 | others (all other commands in `$PATH` that have git- prefix), |
Nguyễn Thái Ngọc Duy | e11dca1 | 2018-05-20 20:40:07 +0200 | [diff] [blame] | 173 | list-<category> (see categories in command-list.txt), |
Nguyễn Thái Ngọc Duy | 6532f37 | 2018-05-20 20:40:09 +0200 | [diff] [blame] | 174 | nohelpers (exclude helper commands), alias and config |
| 175 | (retrieve command list from config variable completion.commands) |
Nguyễn Thái Ngọc Duy | 0089521 | 2018-05-20 20:39:57 +0200 | [diff] [blame] | 176 | |
J. Bruce Fields | 23091e9 | 2006-04-02 17:54:34 -0400 | [diff] [blame] | 177 | GIT COMMANDS |
| 178 | ------------ |
Junio C Hamano | 8db9307 | 2005-08-30 13:51:01 -0700 | [diff] [blame] | 179 | |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 180 | We divide Git into high level ("porcelain") commands and low level |
J. Bruce Fields | 23091e9 | 2006-04-02 17:54:34 -0400 | [diff] [blame] | 181 | ("plumbing") commands. |
Junio C Hamano | e6fc234 | 2005-08-25 00:28:18 -0700 | [diff] [blame] | 182 | |
J. Bruce Fields | 23091e9 | 2006-04-02 17:54:34 -0400 | [diff] [blame] | 183 | High-level commands (porcelain) |
| 184 | ------------------------------- |
| 185 | |
| 186 | We separate the porcelain commands into the main commands and some |
| 187 | ancillary user utilities. |
| 188 | |
| 189 | Main porcelain commands |
| 190 | ~~~~~~~~~~~~~~~~~~~~~~~ |
Junio C Hamano | 905197d | 2005-08-26 21:33:46 -0700 | [diff] [blame] | 191 | |
Junio C Hamano | 377e813 | 2007-01-18 15:03:13 -0800 | [diff] [blame] | 192 | include::cmds-mainporcelain.txt[] |
Junio C Hamano | e31bb3b | 2005-08-15 15:48:47 -0700 | [diff] [blame] | 193 | |
Yasushi SHOJI | 90933ef | 2005-08-16 00:23:06 +0900 | [diff] [blame] | 194 | Ancillary Commands |
J. Bruce Fields | 23091e9 | 2006-04-02 17:54:34 -0400 | [diff] [blame] | 195 | ~~~~~~~~~~~~~~~~~~ |
David Greaves | 204ee6a | 2005-05-10 22:32:37 +0100 | [diff] [blame] | 196 | Manipulators: |
| 197 | |
Junio C Hamano | 377e813 | 2007-01-18 15:03:13 -0800 | [diff] [blame] | 198 | include::cmds-ancillarymanipulators.txt[] |
Junio C Hamano | 7fc9d69 | 2005-08-23 01:49:47 -0700 | [diff] [blame] | 199 | |
Junio C Hamano | f85a419 | 2005-08-29 17:21:06 -0700 | [diff] [blame] | 200 | Interrogators: |
Junio C Hamano | 7fc9d69 | 2005-08-23 01:49:47 -0700 | [diff] [blame] | 201 | |
Junio C Hamano | 377e813 | 2007-01-18 15:03:13 -0800 | [diff] [blame] | 202 | include::cmds-ancillaryinterrogators.txt[] |
Junio C Hamano | 35ef3a4 | 2005-09-07 23:04:52 -0700 | [diff] [blame] | 203 | |
Junio C Hamano | 89bf207 | 2007-01-18 22:32:38 -0800 | [diff] [blame] | 204 | |
| 205 | Interacting with Others |
| 206 | ~~~~~~~~~~~~~~~~~~~~~~~ |
| 207 | |
| 208 | These commands are to interact with foreign SCM and with other |
| 209 | people via patch over e-mail. |
| 210 | |
| 211 | include::cmds-foreignscminterface.txt[] |
| 212 | |
| 213 | |
Robin Rosenberg | b1f33d6 | 2006-10-29 21:09:48 +0100 | [diff] [blame] | 214 | Low-level commands (plumbing) |
| 215 | ----------------------------- |
| 216 | |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 217 | Although Git includes its |
Robin Rosenberg | b1f33d6 | 2006-10-29 21:09:48 +0100 | [diff] [blame] | 218 | own porcelain layer, its low-level commands are sufficient to support |
| 219 | development of alternative porcelains. Developers of such porcelains |
Dan McGee | 5162e69 | 2007-12-29 00:20:38 -0600 | [diff] [blame] | 220 | might start by reading about linkgit:git-update-index[1] and |
| 221 | linkgit:git-read-tree[1]. |
Robin Rosenberg | b1f33d6 | 2006-10-29 21:09:48 +0100 | [diff] [blame] | 222 | |
Junio C Hamano | 89bf207 | 2007-01-18 22:32:38 -0800 | [diff] [blame] | 223 | The interface (input, output, set of options and the semantics) |
| 224 | to these low-level commands are meant to be a lot more stable |
| 225 | than Porcelain level commands, because these commands are |
| 226 | primarily for scripted use. The interface to Porcelain commands |
| 227 | on the other hand are subject to change in order to improve the |
| 228 | end user experience. |
| 229 | |
| 230 | The following description divides |
| 231 | the low-level commands into commands that manipulate objects (in |
Robin Rosenberg | b1f33d6 | 2006-10-29 21:09:48 +0100 | [diff] [blame] | 232 | the repository, index, and working tree), commands that interrogate and |
| 233 | compare objects, and commands that move objects and references between |
| 234 | repositories. |
| 235 | |
Junio C Hamano | 89bf207 | 2007-01-18 22:32:38 -0800 | [diff] [blame] | 236 | |
Robin Rosenberg | b1f33d6 | 2006-10-29 21:09:48 +0100 | [diff] [blame] | 237 | Manipulation commands |
| 238 | ~~~~~~~~~~~~~~~~~~~~~ |
Robin Rosenberg | b1f33d6 | 2006-10-29 21:09:48 +0100 | [diff] [blame] | 239 | |
Junio C Hamano | 377e813 | 2007-01-18 15:03:13 -0800 | [diff] [blame] | 240 | include::cmds-plumbingmanipulators.txt[] |
Robin Rosenberg | b1f33d6 | 2006-10-29 21:09:48 +0100 | [diff] [blame] | 241 | |
| 242 | |
| 243 | Interrogation commands |
| 244 | ~~~~~~~~~~~~~~~~~~~~~~ |
| 245 | |
Junio C Hamano | 377e813 | 2007-01-18 15:03:13 -0800 | [diff] [blame] | 246 | include::cmds-plumbinginterrogators.txt[] |
Robin Rosenberg | b1f33d6 | 2006-10-29 21:09:48 +0100 | [diff] [blame] | 247 | |
| 248 | In general, the interrogate commands do not touch the files in |
| 249 | the working tree. |
| 250 | |
| 251 | |
| 252 | Synching repositories |
| 253 | ~~~~~~~~~~~~~~~~~~~~~ |
| 254 | |
Junio C Hamano | 377e813 | 2007-01-18 15:03:13 -0800 | [diff] [blame] | 255 | include::cmds-synchingrepositories.txt[] |
Robin Rosenberg | b1f33d6 | 2006-10-29 21:09:48 +0100 | [diff] [blame] | 256 | |
Ori Avtalion | 57f6ec0 | 2009-08-07 17:24:21 +0300 | [diff] [blame] | 257 | The following are helper commands used by the above; end users |
Junio C Hamano | 89bf207 | 2007-01-18 22:32:38 -0800 | [diff] [blame] | 258 | typically do not use them directly. |
| 259 | |
| 260 | include::cmds-synchelpers.txt[] |
| 261 | |
| 262 | |
| 263 | Internal helper commands |
| 264 | ~~~~~~~~~~~~~~~~~~~~~~~~ |
| 265 | |
| 266 | These are internal helper commands used by other commands; end |
| 267 | users typically do not use them directly. |
| 268 | |
| 269 | include::cmds-purehelpers.txt[] |
| 270 | |
Robin Rosenberg | b1f33d6 | 2006-10-29 21:09:48 +0100 | [diff] [blame] | 271 | |
Junio C Hamano | 5773c9f | 2005-10-29 14:32:56 -0700 | [diff] [blame] | 272 | Configuration Mechanism |
| 273 | ----------------------- |
| 274 | |
Matthieu Moy | c0179c0 | 2013-02-14 16:36:54 +0100 | [diff] [blame] | 275 | Git uses a simple text format to store customizations that are per |
| 276 | repository and are per user. Such a configuration file may look |
| 277 | like this: |
Junio C Hamano | 5773c9f | 2005-10-29 14:32:56 -0700 | [diff] [blame] | 278 | |
| 279 | ------------ |
| 280 | # |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 281 | # A '#' or ';' character indicates a comment. |
Junio C Hamano | 5773c9f | 2005-10-29 14:32:56 -0700 | [diff] [blame] | 282 | # |
| 283 | |
| 284 | ; core variables |
| 285 | [core] |
| 286 | ; Don't trust file modes |
| 287 | filemode = false |
| 288 | |
| 289 | ; user identity |
| 290 | [user] |
| 291 | name = "Junio C Hamano" |
Matthieu Moy | c0179c0 | 2013-02-14 16:36:54 +0100 | [diff] [blame] | 292 | email = "gitster@pobox.com" |
Junio C Hamano | 5773c9f | 2005-10-29 14:32:56 -0700 | [diff] [blame] | 293 | |
| 294 | ------------ |
| 295 | |
| 296 | Various commands read from the configuration file and adjust |
Jonathan Nieder | 06300d9 | 2010-02-14 06:02:35 -0600 | [diff] [blame] | 297 | their operation accordingly. See linkgit:git-config[1] for a |
Matthieu Moy | c0179c0 | 2013-02-14 16:36:54 +0100 | [diff] [blame] | 298 | list and more details about the configuration mechanism. |
Junio C Hamano | 5773c9f | 2005-10-29 14:32:56 -0700 | [diff] [blame] | 299 | |
| 300 | |
David Greaves | 6c84e2e | 2005-05-22 18:44:16 +0100 | [diff] [blame] | 301 | Identifier Terminology |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 302 | ---------------------- |
| 303 | <object>:: |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 304 | Indicates the object name for any type of object. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 305 | |
| 306 | <blob>:: |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 307 | Indicates a blob object name. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 308 | |
| 309 | <tree>:: |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 310 | Indicates a tree object name. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 311 | |
| 312 | <commit>:: |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 313 | Indicates a commit object name. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 314 | |
| 315 | <tree-ish>:: |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 316 | Indicates a tree, commit or tag object name. A |
David Greaves | 6c84e2e | 2005-05-22 18:44:16 +0100 | [diff] [blame] | 317 | command that takes a <tree-ish> argument ultimately wants to |
| 318 | operate on a <tree> object but automatically dereferences |
| 319 | <commit> and <tag> objects that point at a <tree>. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 320 | |
Theodore Ts'o | 043d760 | 2007-03-05 14:46:05 -0500 | [diff] [blame] | 321 | <commit-ish>:: |
| 322 | Indicates a commit or tag object name. A |
| 323 | command that takes a <commit-ish> argument ultimately wants to |
| 324 | operate on a <commit> object but automatically dereferences |
| 325 | <tag> objects that point at a <commit>. |
| 326 | |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 327 | <type>:: |
| 328 | Indicates that an object type is required. |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 329 | Currently one of: `blob`, `tree`, `commit`, or `tag`. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 330 | |
| 331 | <file>:: |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 332 | Indicates a filename - almost always relative to the |
| 333 | root of the tree structure `GIT_INDEX_FILE` describes. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 334 | |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 335 | Symbolic Identifiers |
| 336 | -------------------- |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 337 | Any Git command accepting any <object> can also use the following |
David Greaves | 6c84e2e | 2005-05-22 18:44:16 +0100 | [diff] [blame] | 338 | symbolic notation: |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 339 | |
| 340 | HEAD:: |
Junio C Hamano | 0abcfbf | 2011-06-23 09:35:10 -0700 | [diff] [blame] | 341 | indicates the head of the current branch. |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 342 | |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 343 | <tag>:: |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 344 | a valid tag 'name' |
Junio C Hamano | 0abcfbf | 2011-06-23 09:35:10 -0700 | [diff] [blame] | 345 | (i.e. a `refs/tags/<tag>` reference). |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 346 | |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 347 | <head>:: |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 348 | a valid head 'name' |
Junio C Hamano | 0abcfbf | 2011-06-23 09:35:10 -0700 | [diff] [blame] | 349 | (i.e. a `refs/heads/<head>` reference). |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 350 | |
Junio C Hamano | d47107d | 2006-10-25 11:33:08 -0700 | [diff] [blame] | 351 | For a more complete list of ways to spell object names, see |
Jonathan Nieder | 9d83e38 | 2010-10-11 11:03:32 -0500 | [diff] [blame] | 352 | "SPECIFYING REVISIONS" section in linkgit:gitrevisions[7]. |
Junio C Hamano | d47107d | 2006-10-25 11:33:08 -0700 | [diff] [blame] | 353 | |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 354 | |
| 355 | File/Directory Structure |
| 356 | ------------------------ |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 357 | |
Jonathan Nieder | 6998e4d | 2008-06-30 17:01:21 -0500 | [diff] [blame] | 358 | Please see the linkgit:gitrepository-layout[5] document. |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 359 | |
Jonathan Nieder | 6998e4d | 2008-06-30 17:01:21 -0500 | [diff] [blame] | 360 | Read linkgit:githooks[5] for more details about each hook. |
Jon Loeliger | 6250ad1 | 2006-03-24 21:21:07 -0600 | [diff] [blame] | 361 | |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 362 | Higher level SCMs may provide and manage additional information in the |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 363 | `$GIT_DIR`. |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 364 | |
Junio C Hamano | a1d4aa7 | 2005-09-01 16:56:13 -0700 | [diff] [blame] | 365 | |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 366 | Terminology |
| 367 | ----------- |
Jonathan Nieder | 6998e4d | 2008-06-30 17:01:21 -0500 | [diff] [blame] | 368 | Please see linkgit:gitglossary[7]. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 369 | |
| 370 | |
| 371 | Environment Variables |
| 372 | --------------------- |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 373 | Various Git commands use the following environment variables: |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 374 | |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 375 | The Git Repository |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 376 | ~~~~~~~~~~~~~~~~~~ |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 377 | These environment variables apply to 'all' core Git commands. Nb: it |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 378 | is worth noting that they may be used/overridden by SCMS sitting above |
Eric Sunshine | f25b98e | 2015-07-24 00:00:54 -0400 | [diff] [blame] | 379 | Git so take care if using a foreign front-end. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 380 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 381 | `GIT_INDEX_FILE`:: |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 382 | This environment allows the specification of an alternate |
Lukas_Sandström | 5f3aa19 | 2005-11-11 02:12:27 +0100 | [diff] [blame] | 383 | index file. If not specified, the default of `$GIT_DIR/index` |
| 384 | is used. |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 385 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 386 | `GIT_INDEX_VERSION`:: |
Thomas Gummerer | 136347d | 2014-02-23 21:49:57 +0100 | [diff] [blame] | 387 | This environment variable allows the specification of an index |
| 388 | version for new repositories. It won't affect existing index |
Nguyễn Thái Ngọc Duy | 7032054 | 2015-03-24 07:28:33 +0700 | [diff] [blame] | 389 | files. By default index file version 2 or 3 is used. See |
| 390 | linkgit:git-update-index[1] for more information. |
Thomas Gummerer | 136347d | 2014-02-23 21:49:57 +0100 | [diff] [blame] | 391 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 392 | `GIT_OBJECT_DIRECTORY`:: |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 393 | If the object storage directory is specified via this |
| 394 | environment variable then the sha1 directories are created |
| 395 | underneath - otherwise the default `$GIT_DIR/objects` |
| 396 | directory is used. |
| 397 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 398 | `GIT_ALTERNATE_OBJECT_DIRECTORIES`:: |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 399 | Due to the immutable nature of Git objects, old objects can be |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 400 | archived into shared, read-only directories. This variable |
Johannes Sixt | 80ba074 | 2007-12-03 21:55:57 +0100 | [diff] [blame] | 401 | specifies a ":" separated (on Windows ";" separated) list |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 402 | of Git object directories which can be used to search for Git |
Johannes Sixt | 80ba074 | 2007-12-03 21:55:57 +0100 | [diff] [blame] | 403 | objects. New objects will not be written to these directories. |
Jeff King | cf3c635 | 2016-12-12 14:52:22 -0500 | [diff] [blame] | 404 | + |
| 405 | Entries that begin with `"` (double-quote) will be interpreted |
| 406 | as C-style quoted paths, removing leading and trailing |
| 407 | double-quotes and respecting backslash escapes. E.g., the value |
| 408 | `"path-with-\"-and-:-in-it":vanilla-path` has two paths: |
| 409 | `path-with-"-and-:-in-it` and `vanilla-path`. |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 410 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 411 | `GIT_DIR`:: |
| 412 | If the `GIT_DIR` environment variable is set then it |
Junio C Hamano | 2fa090b | 2005-12-07 16:05:21 -0800 | [diff] [blame] | 413 | specifies a path to use instead of the default `.git` |
| 414 | for the base of the repository. |
Matthieu Moy | bcf9626 | 2016-06-28 13:40:11 +0200 | [diff] [blame] | 415 | The `--git-dir` command-line option also sets this value. |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 416 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 417 | `GIT_WORK_TREE`:: |
Chris Rorvick | a758a34 | 2013-05-30 20:11:41 -0500 | [diff] [blame] | 418 | Set the path to the root of the working tree. |
Matthieu Moy | bcf9626 | 2016-06-28 13:40:11 +0200 | [diff] [blame] | 419 | This can also be controlled by the `--work-tree` command-line |
Matthias Lederhofer | 892c41b | 2007-06-06 09:10:42 +0200 | [diff] [blame] | 420 | option and the core.worktree configuration variable. |
| 421 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 422 | `GIT_NAMESPACE`:: |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 423 | Set the Git namespace; see linkgit:gitnamespaces[7] for details. |
Matthieu Moy | bcf9626 | 2016-06-28 13:40:11 +0200 | [diff] [blame] | 424 | The `--namespace` command-line option also sets this value. |
Josh Triplett | d49483f | 2011-07-08 16:14:10 -0700 | [diff] [blame] | 425 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 426 | `GIT_CEILING_DIRECTORIES`:: |
Michael Haggerty | 7ec30aa | 2013-02-20 10:09:24 +0100 | [diff] [blame] | 427 | This should be a colon-separated list of absolute paths. If |
Junio C Hamano | 3e07d26 | 2013-02-27 09:47:27 -0800 | [diff] [blame] | 428 | set, it is a list of directories that Git should not chdir up |
Michael Haggerty | 7ec30aa | 2013-02-20 10:09:24 +0100 | [diff] [blame] | 429 | into while looking for a repository directory (useful for |
| 430 | excluding slow-loading network directories). It will not |
| 431 | exclude the current working directory or a GIT_DIR set on the |
| 432 | command line or in the environment. Normally, Git has to read |
| 433 | the entries in this list and resolve any symlink that |
| 434 | might be present in order to compare them with the current |
| 435 | directory. However, if even this access is slow, you |
| 436 | can add an empty entry to the list to tell Git that the |
| 437 | subsequent entries are not symlinks and needn't be resolved; |
| 438 | e.g., |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 439 | `GIT_CEILING_DIRECTORIES=/maybe/symlink::/very/slow/non/symlink`. |
David Reiss | 0454dd9 | 2008-05-19 23:49:26 -0700 | [diff] [blame] | 440 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 441 | `GIT_DISCOVERY_ACROSS_FILESYSTEM`:: |
Junio C Hamano | e640551 | 2010-04-04 10:33:53 -0700 | [diff] [blame] | 442 | When run in a directory that does not have ".git" repository |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 443 | directory, Git tries to find such a directory in the parent |
Junio C Hamano | e640551 | 2010-04-04 10:33:53 -0700 | [diff] [blame] | 444 | directories to find the top of the working tree, but by default it |
| 445 | does not cross filesystem boundaries. This environment variable |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 446 | can be set to true to tell Git not to stop at filesystem |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 447 | boundaries. Like `GIT_CEILING_DIRECTORIES`, this will not affect |
| 448 | an explicit repository directory set via `GIT_DIR` or on the |
Junio C Hamano | cf87463 | 2010-04-04 14:49:31 -0700 | [diff] [blame] | 449 | command line. |
Lars R. Damerow | 8030e44 | 2010-03-17 12:55:53 -0700 | [diff] [blame] | 450 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 451 | `GIT_COMMON_DIR`:: |
Nguyễn Thái Ngọc Duy | c7b3a3d | 2014-11-30 15:24:36 +0700 | [diff] [blame] | 452 | If this variable is set to a path, non-worktree files that are |
| 453 | normally in $GIT_DIR will be taken from this path |
| 454 | instead. Worktree-specific files such as HEAD or index are |
Nguyễn Thái Ngọc Duy | 529fef2 | 2014-11-30 15:24:47 +0700 | [diff] [blame] | 455 | taken from $GIT_DIR. See linkgit:gitrepository-layout[5] and |
Eric Sunshine | 1eaca7a | 2015-07-16 20:17:02 -0400 | [diff] [blame] | 456 | linkgit:git-worktree[1] for |
Nguyễn Thái Ngọc Duy | c7b3a3d | 2014-11-30 15:24:36 +0700 | [diff] [blame] | 457 | details. This variable has lower precedence than other path |
| 458 | variables such as GIT_INDEX_FILE, GIT_OBJECT_DIRECTORY... |
| 459 | |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 460 | Git Commits |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 461 | ~~~~~~~~~~~ |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 462 | `GIT_AUTHOR_NAME`:: |
| 463 | `GIT_AUTHOR_EMAIL`:: |
| 464 | `GIT_AUTHOR_DATE`:: |
| 465 | `GIT_COMMITTER_NAME`:: |
| 466 | `GIT_COMMITTER_EMAIL`:: |
| 467 | `GIT_COMMITTER_DATE`:: |
Josh Triplett | 28a94f8 | 2007-04-28 18:40:28 -0700 | [diff] [blame] | 468 | 'EMAIL':: |
Dan McGee | 5162e69 | 2007-12-29 00:20:38 -0600 | [diff] [blame] | 469 | see linkgit:git-commit-tree[1] |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 470 | |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 471 | Git Diffs |
David Greaves | c1bdacf | 2005-05-10 22:32:38 +0100 | [diff] [blame] | 472 | ~~~~~~~~~ |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 473 | `GIT_DIFF_OPTS`:: |
Sean | fde97d8 | 2006-11-27 14:37:43 -0500 | [diff] [blame] | 474 | Only valid setting is "--unified=??" or "-u??" to set the |
| 475 | number of context lines shown when a unified diff is created. |
| 476 | This takes precedence over any "-U" or "--unified" option |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 477 | value passed on the Git diff command line. |
Sean | fde97d8 | 2006-11-27 14:37:43 -0500 | [diff] [blame] | 478 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 479 | `GIT_EXTERNAL_DIFF`:: |
| 480 | When the environment variable `GIT_EXTERNAL_DIFF` is set, the |
Sean | fde97d8 | 2006-11-27 14:37:43 -0500 | [diff] [blame] | 481 | program named by it is called, instead of the diff invocation |
| 482 | described above. For a path that is added, removed, or modified, |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 483 | `GIT_EXTERNAL_DIFF` is called with 7 parameters: |
Sean | fde97d8 | 2006-11-27 14:37:43 -0500 | [diff] [blame] | 484 | |
| 485 | path old-file old-hex old-mode new-file new-hex new-mode |
| 486 | + |
| 487 | where: |
| 488 | |
| 489 | <old|new>-file:: are files GIT_EXTERNAL_DIFF can use to read the |
| 490 | contents of <old|new>, |
Thomas Ackermann | d5fa1f1 | 2013-04-15 19:49:04 +0200 | [diff] [blame] | 491 | <old|new>-hex:: are the 40-hexdigit SHA-1 hashes, |
Sean | fde97d8 | 2006-11-27 14:37:43 -0500 | [diff] [blame] | 492 | <old|new>-mode:: are the octal representation of the file modes. |
Sean | fde97d8 | 2006-11-27 14:37:43 -0500 | [diff] [blame] | 493 | + |
| 494 | The file parameters can point at the user's working file |
| 495 | (e.g. `new-file` in "git-diff-files"), `/dev/null` (e.g. `old-file` |
| 496 | when a new file is added), or a temporary file (e.g. `old-file` in the |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 497 | index). `GIT_EXTERNAL_DIFF` should not worry about unlinking the |
| 498 | temporary file --- it is removed when `GIT_EXTERNAL_DIFF` exits. |
Sean | fde97d8 | 2006-11-27 14:37:43 -0500 | [diff] [blame] | 499 | + |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 500 | For a path that is unmerged, `GIT_EXTERNAL_DIFF` is called with 1 |
Sean | fde97d8 | 2006-11-27 14:37:43 -0500 | [diff] [blame] | 501 | parameter, <path>. |
Zoltan Klinger | ee7fb0b | 2013-12-06 10:38:46 +1100 | [diff] [blame] | 502 | + |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 503 | For each path `GIT_EXTERNAL_DIFF` is called, two environment variables, |
| 504 | `GIT_DIFF_PATH_COUNTER` and `GIT_DIFF_PATH_TOTAL` are set. |
Zoltan Klinger | ee7fb0b | 2013-12-06 10:38:46 +1100 | [diff] [blame] | 505 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 506 | `GIT_DIFF_PATH_COUNTER`:: |
Zoltan Klinger | ee7fb0b | 2013-12-06 10:38:46 +1100 | [diff] [blame] | 507 | A 1-based counter incremented by one for every path. |
| 508 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 509 | `GIT_DIFF_PATH_TOTAL`:: |
Zoltan Klinger | ee7fb0b | 2013-12-06 10:38:46 +1100 | [diff] [blame] | 510 | The total number of paths. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 511 | |
Matthias Lederhofer | 575ba9d | 2006-06-25 15:56:18 +0200 | [diff] [blame] | 512 | other |
| 513 | ~~~~~ |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 514 | `GIT_MERGE_VERBOSITY`:: |
Jakub Narebski | dbddb71 | 2007-07-13 01:54:06 +0200 | [diff] [blame] | 515 | A number controlling the amount of output shown by |
| 516 | the recursive merge strategy. Overrides merge.verbosity. |
Dan McGee | 5162e69 | 2007-12-29 00:20:38 -0600 | [diff] [blame] | 517 | See linkgit:git-merge[1] |
Jakub Narebski | dbddb71 | 2007-07-13 01:54:06 +0200 | [diff] [blame] | 518 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 519 | `GIT_PAGER`:: |
Steven Grimm | a7738c7 | 2007-07-19 03:43:51 -0700 | [diff] [blame] | 520 | This environment variable overrides `$PAGER`. If it is set |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 521 | to an empty string or to the value "cat", Git will not launch |
Jonathan Nieder | ab54cd6 | 2008-08-24 00:28:32 -0500 | [diff] [blame] | 522 | a pager. See also the `core.pager` option in |
| 523 | linkgit:git-config[1]. |
Matthias Lederhofer | c27d205 | 2006-07-31 15:27:00 +0200 | [diff] [blame] | 524 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 525 | `GIT_EDITOR`:: |
Rodrigo Silva (MestreLion) | 36384c9 | 2012-03-23 12:38:42 +0000 | [diff] [blame] | 526 | This environment variable overrides `$EDITOR` and `$VISUAL`. |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 527 | It is used by several Git commands when, on interactive mode, |
Rodrigo Silva (MestreLion) | 36384c9 | 2012-03-23 12:38:42 +0000 | [diff] [blame] | 528 | an editor is to be launched. See also linkgit:git-var[1] |
| 529 | and the `core.editor` option in linkgit:git-config[1]. |
| 530 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 531 | `GIT_SSH`:: |
| 532 | `GIT_SSH_COMMAND`:: |
Thomas Quinot | 3994276 | 2014-11-09 23:42:32 +0100 | [diff] [blame] | 533 | If either of these environment variables is set then 'git fetch' |
| 534 | and 'git push' will use the specified command instead of 'ssh' |
| 535 | when they need to connect to a remote system. |
Brandon Williams | 94b8ae5 | 2017-10-16 10:55:31 -0700 | [diff] [blame] | 536 | The command-line parameters passed to the configured command are |
| 537 | determined by the ssh variant. See `ssh.variant` option in |
| 538 | linkgit:git-config[1] for details. |
| 539 | |
Shawn O. Pearce | d5538b4 | 2007-08-04 02:06:52 -0400 | [diff] [blame] | 540 | + |
Thomas Quinot | 3994276 | 2014-11-09 23:42:32 +0100 | [diff] [blame] | 541 | `$GIT_SSH_COMMAND` takes precedence over `$GIT_SSH`, and is interpreted |
| 542 | by the shell, which allows additional arguments to be included. |
| 543 | `$GIT_SSH` on the other hand must be just the path to a program |
| 544 | (which can be a wrapper shell script, if additional arguments are |
| 545 | needed). |
Shawn O. Pearce | d5538b4 | 2007-08-04 02:06:52 -0400 | [diff] [blame] | 546 | + |
| 547 | Usually it is easier to configure any desired options through your |
| 548 | personal `.ssh/config` file. Please consult your ssh documentation |
| 549 | for further details. |
| 550 | |
Segev Finer | dd33e07 | 2017-02-01 13:01:16 +0100 | [diff] [blame] | 551 | `GIT_SSH_VARIANT`:: |
| 552 | If this environment variable is set, it overrides Git's autodetection |
| 553 | whether `GIT_SSH`/`GIT_SSH_COMMAND`/`core.sshCommand` refer to OpenSSH, |
| 554 | plink or tortoiseplink. This variable overrides the config setting |
| 555 | `ssh.variant` that serves the same purpose. |
| 556 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 557 | `GIT_ASKPASS`:: |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 558 | If this environment variable is set, then Git commands which need to |
Knut Franke | 453842c | 2010-08-30 15:40:29 +0200 | [diff] [blame] | 559 | acquire passwords or passphrases (e.g. for HTTP or IMAP authentication) |
Jason St. John | 06ab60c | 2014-05-21 14:52:26 -0400 | [diff] [blame] | 560 | will call this program with a suitable prompt as command-line argument |
Tom Russello | ae9f631 | 2016-06-08 19:23:16 +0200 | [diff] [blame] | 561 | and read the password from its STDOUT. See also the `core.askPass` |
Knut Franke | 453842c | 2010-08-30 15:40:29 +0200 | [diff] [blame] | 562 | option in linkgit:git-config[1]. |
| 563 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 564 | `GIT_TERMINAL_PROMPT`:: |
Jeff King | e652c0e | 2014-12-03 22:52:29 -0500 | [diff] [blame] | 565 | If this environment variable is set to `0`, git will not prompt |
| 566 | on the terminal (e.g., when asking for HTTP authentication). |
| 567 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 568 | `GIT_CONFIG_NOSYSTEM`:: |
Jonathan Nieder | e8ef401 | 2012-10-14 01:53:59 -0700 | [diff] [blame] | 569 | Whether to skip reading settings from the system-wide |
| 570 | `$(prefix)/etc/gitconfig` file. This environment variable can |
| 571 | be used along with `$HOME` and `$XDG_CONFIG_HOME` to create a |
| 572 | predictable environment for a picky script, or you can set it |
| 573 | temporarily to avoid using a buggy `/etc/gitconfig` file while |
| 574 | waiting for someone with sufficient permissions to fix it. |
| 575 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 576 | `GIT_FLUSH`:: |
Theodore Ts'o | 06f59e9 | 2007-06-29 13:40:46 -0400 | [diff] [blame] | 577 | If this environment variable is set to "1", then commands such |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 578 | as 'git blame' (in incremental mode), 'git rev-list', 'git log', |
Junio C Hamano | 627a8b8 | 2013-08-09 10:28:53 -0700 | [diff] [blame] | 579 | 'git check-attr' and 'git check-ignore' will |
Adam Spiers | f1ed7fe | 2013-04-11 13:05:13 +0100 | [diff] [blame] | 580 | force a flush of the output stream after each record have been |
| 581 | flushed. If this |
Theodore Ts'o | 06f59e9 | 2007-06-29 13:40:46 -0400 | [diff] [blame] | 582 | variable is set to "0", the output of these commands will be done |
| 583 | using completely buffered I/O. If this environment variable is |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 584 | not set, Git will choose buffered or record-oriented flushing |
Theodore Ts'o | 06f59e9 | 2007-06-29 13:40:46 -0400 | [diff] [blame] | 585 | based on whether stdout appears to be redirected to a file or not. |
| 586 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 587 | `GIT_TRACE`:: |
Karsten Blees | eb9250d | 2014-07-12 02:00:53 +0200 | [diff] [blame] | 588 | Enables general trace messages, e.g. alias expansion, built-in |
| 589 | command execution and external command execution. |
| 590 | + |
| 591 | If this variable is set to "1", "2" or "true" (comparison |
| 592 | is case insensitive), trace messages will be printed to |
| 593 | stderr. |
| 594 | + |
| 595 | If the variable is set to an integer value greater than 2 |
| 596 | and lower than 10 (strictly) then Git will interpret this |
| 597 | value as an open file descriptor and will try to write the |
| 598 | trace messages into this file descriptor. |
| 599 | + |
| 600 | Alternatively, if the variable is set to an absolute path |
| 601 | (starting with a '/' character), Git will interpret this |
| 602 | as a file path and will try to write the trace messages |
| 603 | into it. |
| 604 | + |
| 605 | Unsetting the variable, or setting it to empty, "0" or |
| 606 | "false" (case insensitive) disables trace messages. |
Matthias Lederhofer | 575ba9d | 2006-06-25 15:56:18 +0200 | [diff] [blame] | 607 | |
Alex Vandiver | bd76afd | 2017-10-27 16:26:36 -0700 | [diff] [blame] | 608 | `GIT_TRACE_FSMONITOR`:: |
| 609 | Enables trace messages for the filesystem monitor extension. |
| 610 | See `GIT_TRACE` for available trace output options. |
| 611 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 612 | `GIT_TRACE_PACK_ACCESS`:: |
Karsten Blees | 67dc598 | 2014-07-12 02:01:38 +0200 | [diff] [blame] | 613 | Enables trace messages for all accesses to any packs. For each |
Nguyễn Thái Ngọc Duy | b12ca96 | 2013-06-09 12:22:48 +0700 | [diff] [blame] | 614 | access, the pack file name and an offset in the pack is |
| 615 | recorded. This may be helpful for troubleshooting some |
| 616 | pack-related performance problems. |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 617 | See `GIT_TRACE` for available trace output options. |
Nguyễn Thái Ngọc Duy | b12ca96 | 2013-06-09 12:22:48 +0700 | [diff] [blame] | 618 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 619 | `GIT_TRACE_PACKET`:: |
Karsten Blees | eb9250d | 2014-07-12 02:00:53 +0200 | [diff] [blame] | 620 | Enables trace messages for all packets coming in or out of a |
| 621 | given program. This can help with debugging object negotiation |
| 622 | or other protocol issues. Tracing is turned off at a packet |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 623 | starting with "PACK" (but see `GIT_TRACE_PACKFILE` below). |
| 624 | See `GIT_TRACE` for available trace output options. |
Karsten Blees | eb9250d | 2014-07-12 02:00:53 +0200 | [diff] [blame] | 625 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 626 | `GIT_TRACE_PACKFILE`:: |
Jeff King | 3235983 | 2015-06-16 13:23:20 -0400 | [diff] [blame] | 627 | Enables tracing of packfiles sent or received by a |
| 628 | given program. Unlike other trace output, this trace is |
| 629 | verbatim: no headers, and no quoting of binary data. You almost |
| 630 | certainly want to direct into a file (e.g., |
| 631 | `GIT_TRACE_PACKFILE=/tmp/my.pack`) rather than displaying it on |
| 632 | the terminal or mixing it with other trace output. |
| 633 | + |
| 634 | Note that this is currently only implemented for the client side |
| 635 | of clones and fetches. |
| 636 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 637 | `GIT_TRACE_PERFORMANCE`:: |
Karsten Blees | 578da03 | 2014-07-12 02:07:01 +0200 | [diff] [blame] | 638 | Enables performance related trace messages, e.g. total execution |
| 639 | time of each Git command. |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 640 | See `GIT_TRACE` for available trace output options. |
Karsten Blees | 578da03 | 2014-07-12 02:07:01 +0200 | [diff] [blame] | 641 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 642 | `GIT_TRACE_SETUP`:: |
Karsten Blees | eb9250d | 2014-07-12 02:00:53 +0200 | [diff] [blame] | 643 | Enables trace messages printing the .git, working tree and current |
| 644 | working directory after Git has completed its setup phase. |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 645 | See `GIT_TRACE` for available trace output options. |
Karsten Blees | eb9250d | 2014-07-12 02:00:53 +0200 | [diff] [blame] | 646 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 647 | `GIT_TRACE_SHALLOW`:: |
Karsten Blees | eb9250d | 2014-07-12 02:00:53 +0200 | [diff] [blame] | 648 | Enables trace messages that can help debugging fetching / |
| 649 | cloning of shallow repositories. |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 650 | See `GIT_TRACE` for available trace output options. |
Nguyễn Thái Ngọc Duy | 1dd278c | 2013-06-09 12:22:49 +0700 | [diff] [blame] | 651 | |
Junio C Hamano | 2f84df2 | 2016-07-06 13:38:06 -0700 | [diff] [blame] | 652 | `GIT_TRACE_CURL`:: |
Elia Pinto | 74c682d | 2016-05-23 13:44:02 +0000 | [diff] [blame] | 653 | Enables a curl full trace dump of all incoming and outgoing data, |
| 654 | including descriptive information, of the git transport protocol. |
Junio C Hamano | 2f84df2 | 2016-07-06 13:38:06 -0700 | [diff] [blame] | 655 | This is similar to doing curl `--trace-ascii` on the command line. |
| 656 | This option overrides setting the `GIT_CURL_VERBOSE` environment |
Elia Pinto | 74c682d | 2016-05-23 13:44:02 +0000 | [diff] [blame] | 657 | variable. |
Junio C Hamano | 2f84df2 | 2016-07-06 13:38:06 -0700 | [diff] [blame] | 658 | See `GIT_TRACE` for available trace output options. |
Elia Pinto | 74c682d | 2016-05-23 13:44:02 +0000 | [diff] [blame] | 659 | |
Jonathan Tan | 8ba18e6 | 2018-01-18 16:28:02 -0800 | [diff] [blame] | 660 | `GIT_TRACE_CURL_NO_DATA`:: |
| 661 | When a curl trace is enabled (see `GIT_TRACE_CURL` above), do not dump |
| 662 | data (that is, only dump info lines and headers). |
| 663 | |
Jonathan Tan | 8341178 | 2018-01-18 16:28:01 -0800 | [diff] [blame] | 664 | `GIT_REDACT_COOKIES`:: |
| 665 | This can be set to a comma-separated list of strings. When a curl trace |
| 666 | is enabled (see `GIT_TRACE_CURL` above), whenever a "Cookies:" header |
| 667 | sent by the client is dumped, values of cookies whose key is in that |
| 668 | list (case-sensitive) are redacted. |
| 669 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 670 | `GIT_LITERAL_PATHSPECS`:: |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 671 | Setting this variable to `1` will cause Git to treat all |
Jeff King | 823ab40 | 2012-12-19 17:37:30 -0500 | [diff] [blame] | 672 | pathspecs literally, rather than as glob patterns. For example, |
| 673 | running `GIT_LITERAL_PATHSPECS=1 git log -- '*.c'` will search |
| 674 | for commits that touch the path `*.c`, not any paths that the |
| 675 | glob `*.c` matches. You might want this if you are feeding |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 676 | literal paths to Git (e.g., paths previously given to you by |
Jeff King | 823ab40 | 2012-12-19 17:37:30 -0500 | [diff] [blame] | 677 | `git ls-tree`, `--raw` diff output, etc). |
| 678 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 679 | `GIT_GLOB_PATHSPECS`:: |
Nguyễn Thái Ngọc Duy | bd30c2e | 2013-07-14 15:36:08 +0700 | [diff] [blame] | 680 | Setting this variable to `1` will cause Git to treat all |
| 681 | pathspecs as glob patterns (aka "glob" magic). |
| 682 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 683 | `GIT_NOGLOB_PATHSPECS`:: |
Nguyễn Thái Ngọc Duy | bd30c2e | 2013-07-14 15:36:08 +0700 | [diff] [blame] | 684 | Setting this variable to `1` will cause Git to treat all |
| 685 | pathspecs as literal (aka "literal" magic). |
| 686 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 687 | `GIT_ICASE_PATHSPECS`:: |
Nguyễn Thái Ngọc Duy | 93d9353 | 2013-07-14 15:36:09 +0700 | [diff] [blame] | 688 | Setting this variable to `1` will cause Git to treat all |
| 689 | pathspecs as case-insensitive. |
| 690 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 691 | `GIT_REFLOG_ACTION`:: |
Junio C Hamano | c3e2d18 | 2013-06-19 10:54:00 -0700 | [diff] [blame] | 692 | When a ref is updated, reflog entries are created to keep |
| 693 | track of the reason why the ref was updated (which is |
| 694 | typically the name of the high-level command that updated |
| 695 | the ref), in addition to the old and new values of the ref. |
| 696 | A scripted Porcelain command can use set_reflog_action |
| 697 | helper function in `git-sh-setup` to set its name to this |
| 698 | variable when it is invoked as the top level command by the |
| 699 | end user, to be recorded in the body of the reflog. |
| 700 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 701 | `GIT_REF_PARANOIA`:: |
Jeff King | 49672f2 | 2015-03-20 14:43:06 -0400 | [diff] [blame] | 702 | If set to `1`, include broken or badly named refs when iterating |
| 703 | over lists of refs. In a normal, non-corrupted repository, this |
| 704 | does nothing. However, enabling it may help git to detect and |
| 705 | abort some operations in the presence of broken refs. Git sets |
| 706 | this variable automatically when performing destructive |
| 707 | operations like linkgit:git-prune[1]. You should not need to set |
| 708 | it yourself unless you want to be paranoid about making sure |
| 709 | an operation has touched every ref (e.g., because you are |
| 710 | cloning a repository to make a backup). |
| 711 | |
Tom Russello | eee7f4a | 2016-06-08 00:35:06 +0200 | [diff] [blame] | 712 | `GIT_ALLOW_PROTOCOL`:: |
Brandon Williams | f1762d7 | 2016-12-14 14:39:52 -0800 | [diff] [blame] | 713 | If set to a colon-separated list of protocols, behave as if |
| 714 | `protocol.allow` is set to `never`, and each of the listed |
| 715 | protocols has `protocol.<name>.allow` set to `always` |
| 716 | (overriding any existing configuration). In other words, any |
| 717 | protocol not mentioned will be disallowed (i.e., this is a |
| 718 | whitelist, not a blacklist). See the description of |
| 719 | `protocol.allow` in linkgit:git-config[1] for more details. |
Jeff King | a5adace | 2015-09-16 13:12:52 -0400 | [diff] [blame] | 720 | |
Brandon Williams | f1762d7 | 2016-12-14 14:39:52 -0800 | [diff] [blame] | 721 | `GIT_PROTOCOL_FROM_USER`:: |
| 722 | Set to 0 to prevent protocols used by fetch/push/clone which are |
| 723 | configured to the `user` state. This is useful to restrict recursive |
| 724 | submodule initialization from an untrusted repository or for programs |
| 725 | which feed potentially-untrusted URLS to git commands. See |
| 726 | linkgit:git-config[1] for more details. |
Jeff King | 823ab40 | 2012-12-19 17:37:30 -0500 | [diff] [blame] | 727 | |
Brandon Williams | 373d70e | 2017-10-16 10:55:24 -0700 | [diff] [blame] | 728 | `GIT_PROTOCOL`:: |
| 729 | For internal use only. Used in handshaking the wire protocol. |
| 730 | Contains a colon ':' separated list of keys with optional values |
| 731 | 'key[=value]'. Presence of unknown keys and values must be |
| 732 | ignored. |
| 733 | |
Jeff King | 27344d6 | 2017-09-27 02:54:30 -0400 | [diff] [blame] | 734 | `GIT_OPTIONAL_LOCKS`:: |
| 735 | If set to `0`, Git will complete any requested operation without |
| 736 | performing any optional sub-operations that require taking a lock. |
| 737 | For example, this will prevent `git status` from refreshing the |
| 738 | index as a side effect. This is useful for processes running in |
| 739 | the background which do not want to cause lock contention with |
| 740 | other operations on the repository. Defaults to `1`. |
| 741 | |
Johannes Schindelin | b2f5571 | 2017-11-01 18:10:33 +0100 | [diff] [blame] | 742 | `GIT_REDIRECT_STDIN`:: |
| 743 | `GIT_REDIRECT_STDOUT`:: |
| 744 | `GIT_REDIRECT_STDERR`:: |
| 745 | Windows-only: allow redirecting the standard input/output/error |
| 746 | handles to paths specified by the environment variables. This is |
| 747 | particularly useful in multi-threaded applications where the |
| 748 | canonical way to pass standard handles via `CreateProcess()` is |
| 749 | not an option because it would require the handles to be marked |
| 750 | inheritable (and consequently *every* spawned process would |
| 751 | inherit them, possibly blocking regular Git operations). The |
| 752 | primary intended use case is to use named pipes for communication |
| 753 | (e.g. `\\.\pipe\my-git-stdin-123`). |
| 754 | + |
| 755 | Two special values are supported: `off` will simply close the |
| 756 | corresponding standard handle, and if `GIT_REDIRECT_STDERR` is |
| 757 | `2>&1`, standard error will be redirected to the same handle as |
| 758 | standard output. |
| 759 | |
Ann T Ropea | a2cd709 | 2017-12-03 22:27:39 +0100 | [diff] [blame] | 760 | `GIT_PRINT_SHA1_ELLIPSIS` (deprecated):: |
| 761 | If set to `yes`, print an ellipsis following an |
| 762 | (abbreviated) SHA-1 value. This affects indications of |
| 763 | detached HEADs (linkgit:git-checkout[1]) and the raw |
| 764 | diff output (linkgit:git-diff[1]). Printing an |
| 765 | ellipsis in the cases mentioned is no longer considered |
| 766 | adequate and support for it is likely to be removed in the |
| 767 | foreseeable future (along with the variable). |
| 768 | |
Junio C Hamano | 8db9307 | 2005-08-30 13:51:01 -0700 | [diff] [blame] | 769 | Discussion[[Discussion]] |
| 770 | ------------------------ |
J. Bruce Fields | 40dac51 | 2007-09-03 00:01:19 -0400 | [diff] [blame] | 771 | |
| 772 | More detail on the following is available from the |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 773 | link:user-manual.html#git-concepts[Git concepts chapter of the |
Jonathan Nieder | 6998e4d | 2008-06-30 17:01:21 -0500 | [diff] [blame] | 774 | user-manual] and linkgit:gitcore-tutorial[7]. |
J. Bruce Fields | 40dac51 | 2007-09-03 00:01:19 -0400 | [diff] [blame] | 775 | |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 776 | A Git project normally consists of a working directory with a ".git" |
J. Bruce Fields | 40dac51 | 2007-09-03 00:01:19 -0400 | [diff] [blame] | 777 | subdirectory at the top level. The .git directory contains, among other |
| 778 | things, a compressed object database representing the complete history |
| 779 | of the project, an "index" file which links that history to the current |
| 780 | contents of the working tree, and named pointers into that history such |
| 781 | as tags and branch heads. |
| 782 | |
| 783 | The object database contains objects of three main types: blobs, which |
| 784 | hold file data; trees, which point to blobs and other trees to build up |
Ralf Wildenhues | 02ff625 | 2007-12-18 07:07:36 +0100 | [diff] [blame] | 785 | directory hierarchies; and commits, which each reference a single tree |
J. Bruce Fields | 40dac51 | 2007-09-03 00:01:19 -0400 | [diff] [blame] | 786 | and some number of parent commits. |
| 787 | |
| 788 | The commit, equivalent to what other systems call a "changeset" or |
| 789 | "version", represents a step in the project's history, and each parent |
| 790 | represents an immediately preceding step. Commits with more than one |
| 791 | parent represent merges of independent lines of development. |
| 792 | |
Thomas Ackermann | d5fa1f1 | 2013-04-15 19:49:04 +0200 | [diff] [blame] | 793 | All objects are named by the SHA-1 hash of their contents, normally |
J. Bruce Fields | 40dac51 | 2007-09-03 00:01:19 -0400 | [diff] [blame] | 794 | written as a string of 40 hex digits. Such names are globally unique. |
| 795 | The entire history leading up to a commit can be vouched for by signing |
| 796 | just that commit. A fourth object type, the tag, is provided for this |
| 797 | purpose. |
| 798 | |
| 799 | When first created, objects are stored in individual files, but for |
| 800 | efficiency may later be compressed together into "pack files". |
| 801 | |
| 802 | Named pointers called refs mark interesting points in history. A ref |
Thomas Ackermann | d5fa1f1 | 2013-04-15 19:49:04 +0200 | [diff] [blame] | 803 | may contain the SHA-1 name of an object or the name of another ref. Refs |
| 804 | with names beginning `ref/head/` contain the SHA-1 name of the most |
| 805 | recent commit (or "head") of a branch under development. SHA-1 names of |
J. Bruce Fields | 40dac51 | 2007-09-03 00:01:19 -0400 | [diff] [blame] | 806 | tags of interest are stored under `ref/tags/`. A special ref named |
| 807 | `HEAD` contains the name of the currently checked-out branch. |
| 808 | |
| 809 | The index file is initialized with a list of all paths and, for each |
| 810 | path, a blob object and a set of attributes. The blob object represents |
| 811 | the contents of the file as of the head of the current branch. The |
| 812 | attributes (last modified time, size, etc.) are taken from the |
| 813 | corresponding file in the working tree. Subsequent changes to the |
| 814 | working tree can be found by comparing these attributes. The index may |
| 815 | be updated with new content, and new commits may be created from the |
| 816 | content stored in the index. |
| 817 | |
| 818 | The index is also capable of storing multiple entries (called "stages") |
| 819 | for a given pathname. These stages are used to hold the various |
| 820 | unmerged version of a file when a merge is in progress. |
David Greaves | 6c84e2e | 2005-05-22 18:44:16 +0100 | [diff] [blame] | 821 | |
Junio C Hamano | 7687ae9 | 2012-08-17 12:48:52 -0700 | [diff] [blame] | 822 | FURTHER DOCUMENTATION |
| 823 | --------------------- |
| 824 | |
| 825 | See the references in the "description" section to get started |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 826 | using Git. The following is probably more detail than necessary |
Junio C Hamano | 7687ae9 | 2012-08-17 12:48:52 -0700 | [diff] [blame] | 827 | for a first-time user. |
| 828 | |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 829 | The link:user-manual.html#git-concepts[Git concepts chapter of the |
Junio C Hamano | 7687ae9 | 2012-08-17 12:48:52 -0700 | [diff] [blame] | 830 | user-manual] and linkgit:gitcore-tutorial[7] both provide |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 831 | introductions to the underlying Git architecture. |
Junio C Hamano | 7687ae9 | 2012-08-17 12:48:52 -0700 | [diff] [blame] | 832 | |
| 833 | See linkgit:gitworkflows[7] for an overview of recommended workflows. |
| 834 | |
| 835 | See also the link:howto-index.html[howto] documents for some useful |
| 836 | examples. |
| 837 | |
| 838 | The internals are documented in the |
Thomas Ackermann | 48a8c26 | 2013-01-21 20:16:20 +0100 | [diff] [blame] | 839 | link:technical/api-index.html[Git API documentation]. |
Junio C Hamano | 7687ae9 | 2012-08-17 12:48:52 -0700 | [diff] [blame] | 840 | |
| 841 | Users migrating from CVS may also want to |
| 842 | read linkgit:gitcvs-migration[7]. |
| 843 | |
| 844 | |
Andreas Ericsson | cb22bc4 | 2005-11-16 00:31:25 +0100 | [diff] [blame] | 845 | Authors |
| 846 | ------- |
Jeff King | 48bb914 | 2011-03-11 00:52:08 -0500 | [diff] [blame] | 847 | Git was started by Linus Torvalds, and is currently maintained by Junio |
Thomas Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 848 | C Hamano. Numerous contributions have come from the Git mailing list |
Stefan Beller | 405869d | 2014-07-23 14:32:09 +0200 | [diff] [blame] | 849 | <git@vger.kernel.org>. http://www.openhub.net/p/git/contributors/summary |
Junio C Hamano | 6ecc01f | 2012-12-12 10:06:24 -0800 | [diff] [blame] | 850 | gives you a more complete list of contributors. |
| 851 | |
| 852 | If you have a clone of git.git itself, the |
Jeff King | d8f708f | 2011-03-12 22:00:38 -0500 | [diff] [blame] | 853 | output of linkgit:git-shortlog[1] and linkgit:git-blame[1] can show you |
| 854 | the authors for specific parts of the project. |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 855 | |
Junio C Hamano | c97ca27 | 2010-08-02 09:07:39 -0700 | [diff] [blame] | 856 | Reporting Bugs |
| 857 | -------------- |
| 858 | |
| 859 | Report bugs to the Git mailing list <git@vger.kernel.org> where the |
| 860 | development and maintenance is primarily done. You do not have to be |
| 861 | subscribed to the list to send a message there. |
| 862 | |
Ævar Arnfjörð Bjarmason | 2caa7b8 | 2018-03-08 15:08:20 +0000 | [diff] [blame] | 863 | Issues which are security relevant should be disclosed privately to |
| 864 | the Git Security mailing list <git-security@googlegroups.com>. |
| 865 | |
Christian Couder | 497c833 | 2008-05-29 19:21:46 +0200 | [diff] [blame] | 866 | SEE ALSO |
| 867 | -------- |
| 868 | linkgit:gittutorial[7], linkgit:gittutorial-2[7], |
Philip Oakley | 673151a | 2014-10-10 22:25:37 +0100 | [diff] [blame] | 869 | linkgit:giteveryday[7], linkgit:gitcvs-migration[7], |
Christian Couder | 497c833 | 2008-05-29 19:21:46 +0200 | [diff] [blame] | 870 | linkgit:gitglossary[7], linkgit:gitcore-tutorial[7], |
Thomas Rast | 801a011 | 2009-06-06 15:11:07 +0200 | [diff] [blame] | 871 | linkgit:gitcli[7], link:user-manual.html[The Git User's Manual], |
| 872 | linkgit:gitworkflows[7] |
Christian Couder | 497c833 | 2008-05-29 19:21:46 +0200 | [diff] [blame] | 873 | |
David Greaves | 2cf565c | 2005-05-10 22:32:30 +0100 | [diff] [blame] | 874 | GIT |
| 875 | --- |
Christian Couder | 9e1f0a8 | 2008-06-06 09:07:32 +0200 | [diff] [blame] | 876 | Part of the linkgit:git[1] suite |