1git(1) 2====== 3 4NAME 5---- 6git - the stupid content tracker 7 8 9SYNOPSIS 10-------- 11[verse] 12'git' [--version] [--help] [-c <name>=<value>] 13 [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] 14 [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] 15 [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] 16 <command> [<args>] 17 18DESCRIPTION 19----------- 20Git is a fast, scalable, distributed revision control system with an 21unusually rich command set that provides both high-level operations 22and full access to internals. 23 24See linkgit:gittutorial[7] to get started, then see 25link:everyday.html[Everyday Git] for a useful minimum set of 26commands. The link:user-manual.html[Git User's Manual] has a more 27in-depth introduction. 28 29After you mastered the basic concepts, you can come back to this 30page to learn what commands Git offers. You can learn more about 31individual Git commands with "git help command". linkgit:gitcli[7] 32manual page gives you an overview of the command line command syntax. 33 34Formatted and hyperlinked version of the latest Git documentation 35can be viewed at `http://git-htmldocs.googlecode.com/git/git.html`. 36 37ifdef::stalenotes[] 38[NOTE] 39============ 40 41You are reading the documentation for the latest (possibly 42unreleased) version of Git, that is available from 'master' 43branch of the `git.git` repository. 44Documentation for older releases are available here: 45 46* link:v1.8.2.3/git.html[documentation for release 1.8.2.3] 47 48* release notes for 49 link:RelNotes/1.8.2.3.txt[1.8.2.3]. 50 link:RelNotes/1.8.2.2.txt[1.8.2.2]. 51 link:RelNotes/1.8.2.1.txt[1.8.2.1]. 52 link:RelNotes/1.8.2.txt[1.8.2]. 53 54* link:v1.8.1.6/git.html[documentation for release 1.8.1.6] 55 56* release notes for 57 link:RelNotes/1.8.1.6.txt[1.8.1.6], 58 link:RelNotes/1.8.1.5.txt[1.8.1.5], 59 link:RelNotes/1.8.1.4.txt[1.8.1.4], 60 link:RelNotes/1.8.1.3.txt[1.8.1.3], 61 link:RelNotes/1.8.1.2.txt[1.8.1.2], 62 link:RelNotes/1.8.1.1.txt[1.8.1.1], 63 link:RelNotes/1.8.1.txt[1.8.1]. 64 65* link:v1.8.0.3/git.html[documentation for release 1.8.0.3] 66 67* release notes for 68 link:RelNotes/1.8.0.3.txt[1.8.0.3], 69 link:RelNotes/1.8.0.2.txt[1.8.0.2], 70 link:RelNotes/1.8.0.1.txt[1.8.0.1], 71 link:RelNotes/1.8.0.txt[1.8.0]. 72 73* link:v1.7.12.4/git.html[documentation for release 1.7.12.4] 74 75* release notes for 76 link:RelNotes/1.7.12.4.txt[1.7.12.4], 77 link:RelNotes/1.7.12.3.txt[1.7.12.3], 78 link:RelNotes/1.7.12.2.txt[1.7.12.2], 79 link:RelNotes/1.7.12.1.txt[1.7.12.1], 80 link:RelNotes/1.7.12.txt[1.7.12]. 81 82* link:v1.7.11.7/git.html[documentation for release 1.7.11.7] 83 84* release notes for 85 link:RelNotes/1.7.11.7.txt[1.7.11.7], 86 link:RelNotes/1.7.11.6.txt[1.7.11.6], 87 link:RelNotes/1.7.11.5.txt[1.7.11.5], 88 link:RelNotes/1.7.11.4.txt[1.7.11.4], 89 link:RelNotes/1.7.11.3.txt[1.7.11.3], 90 link:RelNotes/1.7.11.2.txt[1.7.11.2], 91 link:RelNotes/1.7.11.1.txt[1.7.11.1], 92 link:RelNotes/1.7.11.txt[1.7.11]. 93 94* link:v1.7.10.5/git.html[documentation for release 1.7.10.5] 95 96* release notes for 97 link:RelNotes/1.7.10.5.txt[1.7.10.5], 98 link:RelNotes/1.7.10.4.txt[1.7.10.4], 99 link:RelNotes/1.7.10.3.txt[1.7.10.3], 100 link:RelNotes/1.7.10.2.txt[1.7.10.2], 101 link:RelNotes/1.7.10.1.txt[1.7.10.1], 102 link:RelNotes/1.7.10.txt[1.7.10]. 103 104* link:v1.7.9.7/git.html[documentation for release 1.7.9.7] 105 106* release notes for 107 link:RelNotes/1.7.9.7.txt[1.7.9.7], 108 link:RelNotes/1.7.9.6.txt[1.7.9.6], 109 link:RelNotes/1.7.9.5.txt[1.7.9.5], 110 link:RelNotes/1.7.9.4.txt[1.7.9.4], 111 link:RelNotes/1.7.9.3.txt[1.7.9.3], 112 link:RelNotes/1.7.9.2.txt[1.7.9.2], 113 link:RelNotes/1.7.9.1.txt[1.7.9.1], 114 link:RelNotes/1.7.9.txt[1.7.9]. 115 116* link:v1.7.8.6/git.html[documentation for release 1.7.8.6] 117 118* release notes for 119 link:RelNotes/1.7.8.6.txt[1.7.8.6], 120 link:RelNotes/1.7.8.5.txt[1.7.8.5], 121 link:RelNotes/1.7.8.4.txt[1.7.8.4], 122 link:RelNotes/1.7.8.3.txt[1.7.8.3], 123 link:RelNotes/1.7.8.2.txt[1.7.8.2], 124 link:RelNotes/1.7.8.1.txt[1.7.8.1], 125 link:RelNotes/1.7.8.txt[1.7.8]. 126 127* link:v1.7.7.7/git.html[documentation for release 1.7.7.7] 128 129* release notes for 130 link:RelNotes/1.7.7.7.txt[1.7.7.7], 131 link:RelNotes/1.7.7.6.txt[1.7.7.6], 132 link:RelNotes/1.7.7.5.txt[1.7.7.5], 133 link:RelNotes/1.7.7.4.txt[1.7.7.4], 134 link:RelNotes/1.7.7.3.txt[1.7.7.3], 135 link:RelNotes/1.7.7.2.txt[1.7.7.2], 136 link:RelNotes/1.7.7.1.txt[1.7.7.1], 137 link:RelNotes/1.7.7.txt[1.7.7]. 138 139* link:v1.7.6.6/git.html[documentation for release 1.7.6.6] 140 141* release notes for 142 link:RelNotes/1.7.6.6.txt[1.7.6.6], 143 link:RelNotes/1.7.6.5.txt[1.7.6.5], 144 link:RelNotes/1.7.6.4.txt[1.7.6.4], 145 link:RelNotes/1.7.6.3.txt[1.7.6.3], 146 link:RelNotes/1.7.6.2.txt[1.7.6.2], 147 link:RelNotes/1.7.6.1.txt[1.7.6.1], 148 link:RelNotes/1.7.6.txt[1.7.6]. 149 150* link:v1.7.5.4/git.html[documentation for release 1.7.5.4] 151 152* release notes for 153 link:RelNotes/1.7.5.4.txt[1.7.5.4], 154 link:RelNotes/1.7.5.3.txt[1.7.5.3], 155 link:RelNotes/1.7.5.2.txt[1.7.5.2], 156 link:RelNotes/1.7.5.1.txt[1.7.5.1], 157 link:RelNotes/1.7.5.txt[1.7.5]. 158 159* link:v1.7.4.5/git.html[documentation for release 1.7.4.5] 160 161* release notes for 162 link:RelNotes/1.7.4.5.txt[1.7.4.5], 163 link:RelNotes/1.7.4.4.txt[1.7.4.4], 164 link:RelNotes/1.7.4.3.txt[1.7.4.3], 165 link:RelNotes/1.7.4.2.txt[1.7.4.2], 166 link:RelNotes/1.7.4.1.txt[1.7.4.1], 167 link:RelNotes/1.7.4.txt[1.7.4]. 168 169* link:v1.7.3.5/git.html[documentation for release 1.7.3.5] 170 171* release notes for 172 link:RelNotes/1.7.3.5.txt[1.7.3.5], 173 link:RelNotes/1.7.3.4.txt[1.7.3.4], 174 link:RelNotes/1.7.3.3.txt[1.7.3.3], 175 link:RelNotes/1.7.3.2.txt[1.7.3.2], 176 link:RelNotes/1.7.3.1.txt[1.7.3.1], 177 link:RelNotes/1.7.3.txt[1.7.3]. 178 179* link:v1.7.2.5/git.html[documentation for release 1.7.2.5] 180 181* release notes for 182 link:RelNotes/1.7.2.5.txt[1.7.2.5], 183 link:RelNotes/1.7.2.4.txt[1.7.2.4], 184 link:RelNotes/1.7.2.3.txt[1.7.2.3], 185 link:RelNotes/1.7.2.2.txt[1.7.2.2], 186 link:RelNotes/1.7.2.1.txt[1.7.2.1], 187 link:RelNotes/1.7.2.txt[1.7.2]. 188 189* link:v1.7.1.4/git.html[documentation for release 1.7.1.4] 190 191* release notes for 192 link:RelNotes/1.7.1.4.txt[1.7.1.4], 193 link:RelNotes/1.7.1.3.txt[1.7.1.3], 194 link:RelNotes/1.7.1.2.txt[1.7.1.2], 195 link:RelNotes/1.7.1.1.txt[1.7.1.1], 196 link:RelNotes/1.7.1.txt[1.7.1]. 197 198* link:v1.7.0.9/git.html[documentation for release 1.7.0.9] 199 200* release notes for 201 link:RelNotes/1.7.0.9.txt[1.7.0.9], 202 link:RelNotes/1.7.0.8.txt[1.7.0.8], 203 link:RelNotes/1.7.0.7.txt[1.7.0.7], 204 link:RelNotes/1.7.0.6.txt[1.7.0.6], 205 link:RelNotes/1.7.0.5.txt[1.7.0.5], 206 link:RelNotes/1.7.0.4.txt[1.7.0.4], 207 link:RelNotes/1.7.0.3.txt[1.7.0.3], 208 link:RelNotes/1.7.0.2.txt[1.7.0.2], 209 link:RelNotes/1.7.0.1.txt[1.7.0.1], 210 link:RelNotes/1.7.0.txt[1.7.0]. 211 212* link:v1.6.6.3/git.html[documentation for release 1.6.6.3] 213 214* release notes for 215 link:RelNotes/1.6.6.3.txt[1.6.6.3], 216 link:RelNotes/1.6.6.2.txt[1.6.6.2], 217 link:RelNotes/1.6.6.1.txt[1.6.6.1], 218 link:RelNotes/1.6.6.txt[1.6.6]. 219 220* link:v1.6.5.9/git.html[documentation for release 1.6.5.9] 221 222* release notes for 223 link:RelNotes/1.6.5.9.txt[1.6.5.9], 224 link:RelNotes/1.6.5.8.txt[1.6.5.8], 225 link:RelNotes/1.6.5.7.txt[1.6.5.7], 226 link:RelNotes/1.6.5.6.txt[1.6.5.6], 227 link:RelNotes/1.6.5.5.txt[1.6.5.5], 228 link:RelNotes/1.6.5.4.txt[1.6.5.4], 229 link:RelNotes/1.6.5.3.txt[1.6.5.3], 230 link:RelNotes/1.6.5.2.txt[1.6.5.2], 231 link:RelNotes/1.6.5.1.txt[1.6.5.1], 232 link:RelNotes/1.6.5.txt[1.6.5]. 233 234* link:v1.6.4.5/git.html[documentation for release 1.6.4.5] 235 236* release notes for 237 link:RelNotes/1.6.4.5.txt[1.6.4.5], 238 link:RelNotes/1.6.4.4.txt[1.6.4.4], 239 link:RelNotes/1.6.4.3.txt[1.6.4.3], 240 link:RelNotes/1.6.4.2.txt[1.6.4.2], 241 link:RelNotes/1.6.4.1.txt[1.6.4.1], 242 link:RelNotes/1.6.4.txt[1.6.4]. 243 244* link:v1.6.3.4/git.html[documentation for release 1.6.3.4] 245 246* release notes for 247 link:RelNotes/1.6.3.4.txt[1.6.3.4], 248 link:RelNotes/1.6.3.3.txt[1.6.3.3], 249 link:RelNotes/1.6.3.2.txt[1.6.3.2], 250 link:RelNotes/1.6.3.1.txt[1.6.3.1], 251 link:RelNotes/1.6.3.txt[1.6.3]. 252 253* release notes for 254 link:RelNotes/1.6.2.5.txt[1.6.2.5], 255 link:RelNotes/1.6.2.4.txt[1.6.2.4], 256 link:RelNotes/1.6.2.3.txt[1.6.2.3], 257 link:RelNotes/1.6.2.2.txt[1.6.2.2], 258 link:RelNotes/1.6.2.1.txt[1.6.2.1], 259 link:RelNotes/1.6.2.txt[1.6.2]. 260 261* link:v1.6.1.3/git.html[documentation for release 1.6.1.3] 262 263* release notes for 264 link:RelNotes/1.6.1.3.txt[1.6.1.3], 265 link:RelNotes/1.6.1.2.txt[1.6.1.2], 266 link:RelNotes/1.6.1.1.txt[1.6.1.1], 267 link:RelNotes/1.6.1.txt[1.6.1]. 268 269* link:v1.6.0.6/git.html[documentation for release 1.6.0.6] 270 271* release notes for 272 link:RelNotes/1.6.0.6.txt[1.6.0.6], 273 link:RelNotes/1.6.0.5.txt[1.6.0.5], 274 link:RelNotes/1.6.0.4.txt[1.6.0.4], 275 link:RelNotes/1.6.0.3.txt[1.6.0.3], 276 link:RelNotes/1.6.0.2.txt[1.6.0.2], 277 link:RelNotes/1.6.0.1.txt[1.6.0.1], 278 link:RelNotes/1.6.0.txt[1.6.0]. 279 280* link:v1.5.6.6/git.html[documentation for release 1.5.6.6] 281 282* release notes for 283 link:RelNotes/1.5.6.6.txt[1.5.6.6], 284 link:RelNotes/1.5.6.5.txt[1.5.6.5], 285 link:RelNotes/1.5.6.4.txt[1.5.6.4], 286 link:RelNotes/1.5.6.3.txt[1.5.6.3], 287 link:RelNotes/1.5.6.2.txt[1.5.6.2], 288 link:RelNotes/1.5.6.1.txt[1.5.6.1], 289 link:RelNotes/1.5.6.txt[1.5.6]. 290 291* link:v1.5.5.6/git.html[documentation for release 1.5.5.6] 292 293* release notes for 294 link:RelNotes/1.5.5.6.txt[1.5.5.6], 295 link:RelNotes/1.5.5.5.txt[1.5.5.5], 296 link:RelNotes/1.5.5.4.txt[1.5.5.4], 297 link:RelNotes/1.5.5.3.txt[1.5.5.3], 298 link:RelNotes/1.5.5.2.txt[1.5.5.2], 299 link:RelNotes/1.5.5.1.txt[1.5.5.1], 300 link:RelNotes/1.5.5.txt[1.5.5]. 301 302* link:v1.5.4.7/git.html[documentation for release 1.5.4.7] 303 304* release notes for 305 link:RelNotes/1.5.4.7.txt[1.5.4.7], 306 link:RelNotes/1.5.4.6.txt[1.5.4.6], 307 link:RelNotes/1.5.4.5.txt[1.5.4.5], 308 link:RelNotes/1.5.4.4.txt[1.5.4.4], 309 link:RelNotes/1.5.4.3.txt[1.5.4.3], 310 link:RelNotes/1.5.4.2.txt[1.5.4.2], 311 link:RelNotes/1.5.4.1.txt[1.5.4.1], 312 link:RelNotes/1.5.4.txt[1.5.4]. 313 314* link:v1.5.3.8/git.html[documentation for release 1.5.3.8] 315 316* release notes for 317 link:RelNotes/1.5.3.8.txt[1.5.3.8], 318 link:RelNotes/1.5.3.7.txt[1.5.3.7], 319 link:RelNotes/1.5.3.6.txt[1.5.3.6], 320 link:RelNotes/1.5.3.5.txt[1.5.3.5], 321 link:RelNotes/1.5.3.4.txt[1.5.3.4], 322 link:RelNotes/1.5.3.3.txt[1.5.3.3], 323 link:RelNotes/1.5.3.2.txt[1.5.3.2], 324 link:RelNotes/1.5.3.1.txt[1.5.3.1], 325 link:RelNotes/1.5.3.txt[1.5.3]. 326 327* link:v1.5.2.5/git.html[documentation for release 1.5.2.5] 328 329* release notes for 330 link:RelNotes/1.5.2.5.txt[1.5.2.5], 331 link:RelNotes/1.5.2.4.txt[1.5.2.4], 332 link:RelNotes/1.5.2.3.txt[1.5.2.3], 333 link:RelNotes/1.5.2.2.txt[1.5.2.2], 334 link:RelNotes/1.5.2.1.txt[1.5.2.1], 335 link:RelNotes/1.5.2.txt[1.5.2]. 336 337* link:v1.5.1.6/git.html[documentation for release 1.5.1.6] 338 339* release notes for 340 link:RelNotes/1.5.1.6.txt[1.5.1.6], 341 link:RelNotes/1.5.1.5.txt[1.5.1.5], 342 link:RelNotes/1.5.1.4.txt[1.5.1.4], 343 link:RelNotes/1.5.1.3.txt[1.5.1.3], 344 link:RelNotes/1.5.1.2.txt[1.5.1.2], 345 link:RelNotes/1.5.1.1.txt[1.5.1.1], 346 link:RelNotes/1.5.1.txt[1.5.1]. 347 348* link:v1.5.0.7/git.html[documentation for release 1.5.0.7] 349 350* release notes for 351 link:RelNotes/1.5.0.7.txt[1.5.0.7], 352 link:RelNotes/1.5.0.6.txt[1.5.0.6], 353 link:RelNotes/1.5.0.5.txt[1.5.0.5], 354 link:RelNotes/1.5.0.3.txt[1.5.0.3], 355 link:RelNotes/1.5.0.2.txt[1.5.0.2], 356 link:RelNotes/1.5.0.1.txt[1.5.0.1], 357 link:RelNotes/1.5.0.txt[1.5.0]. 358 359* documentation for release link:v1.4.4.4/git.html[1.4.4.4], 360 link:v1.3.3/git.html[1.3.3], 361 link:v1.2.6/git.html[1.2.6], 362 link:v1.0.13/git.html[1.0.13]. 363 364============ 365 366endif::stalenotes[] 367 368OPTIONS 369------- 370--version:: 371 Prints the Git suite version that the 'git' program came from. 372 373--help:: 374 Prints the synopsis and a list of the most commonly used 375 commands. If the option '--all' or '-a' is given then all 376 available commands are printed. If a Git command is named this 377 option will bring up the manual page for that command. 378+ 379Other options are available to control how the manual page is 380displayed. See linkgit:git-help[1] for more information, 381because `git --help ...` is converted internally into `git 382help ...`. 383 384-c <name>=<value>:: 385 Pass a configuration parameter to the command. The value 386 given will override values from configuration files. 387 The <name> is expected in the same format as listed by 388 'git config' (subkeys separated by dots). 389 390--exec-path[=<path>]:: 391 Path to wherever your core Git programs are installed. 392 This can also be controlled by setting the GIT_EXEC_PATH 393 environment variable. If no path is given, 'git' will print 394 the current setting and then exit. 395 396--html-path:: 397 Print the path, without trailing slash, where Git's HTML 398 documentation is installed and exit. 399 400--man-path:: 401 Print the manpath (see `man(1)`) for the man pages for 402 this version of Git and exit. 403 404--info-path:: 405 Print the path where the Info files documenting this 406 version of Git are installed and exit. 407 408-p:: 409--paginate:: 410 Pipe all output into 'less' (or if set, $PAGER) if standard 411 output is a terminal. This overrides the `pager.<cmd>` 412 configuration options (see the "Configuration Mechanism" section 413 below). 414 415--no-pager:: 416 Do not pipe Git output into a pager. 417 418--git-dir=<path>:: 419 Set the path to the repository. This can also be controlled by 420 setting the GIT_DIR environment variable. It can be an absolute 421 path or relative path to current working directory. 422 423--work-tree=<path>:: 424 Set the path to the working tree. It can be an absolute path 425 or a path relative to the current working directory. 426 This can also be controlled by setting the GIT_WORK_TREE 427 environment variable and the core.worktree configuration 428 variable (see core.worktree in linkgit:git-config[1] for a 429 more detailed discussion). 430 431--namespace=<path>:: 432 Set the Git namespace. See linkgit:gitnamespaces[7] for more 433 details. Equivalent to setting the `GIT_NAMESPACE` environment 434 variable. 435 436--bare:: 437 Treat the repository as a bare repository. If GIT_DIR 438 environment is not set, it is set to the current working 439 directory. 440 441--no-replace-objects:: 442 Do not use replacement refs to replace Git objects. See 443 linkgit:git-replace[1] for more information. 444 445--literal-pathspecs:: 446 Treat pathspecs literally, rather than as glob patterns. This is 447 equivalent to setting the `GIT_LITERAL_PATHSPECS` environment 448 variable to `1`. 449 450 451GIT COMMANDS 452------------ 453 454We divide Git into high level ("porcelain") commands and low level 455("plumbing") commands. 456 457High-level commands (porcelain) 458------------------------------- 459 460We separate the porcelain commands into the main commands and some 461ancillary user utilities. 462 463Main porcelain commands 464~~~~~~~~~~~~~~~~~~~~~~~ 465 466include::cmds-mainporcelain.txt[] 467 468Ancillary Commands 469~~~~~~~~~~~~~~~~~~ 470Manipulators: 471 472include::cmds-ancillarymanipulators.txt[] 473 474Interrogators: 475 476include::cmds-ancillaryinterrogators.txt[] 477 478 479Interacting with Others 480~~~~~~~~~~~~~~~~~~~~~~~ 481 482These commands are to interact with foreign SCM and with other 483people via patch over e-mail. 484 485include::cmds-foreignscminterface.txt[] 486 487 488Low-level commands (plumbing) 489----------------------------- 490 491Although Git includes its 492own porcelain layer, its low-level commands are sufficient to support 493development of alternative porcelains. Developers of such porcelains 494might start by reading about linkgit:git-update-index[1] and 495linkgit:git-read-tree[1]. 496 497The interface (input, output, set of options and the semantics) 498to these low-level commands are meant to be a lot more stable 499than Porcelain level commands, because these commands are 500primarily for scripted use. The interface to Porcelain commands 501on the other hand are subject to change in order to improve the 502end user experience. 503 504The following description divides 505the low-level commands into commands that manipulate objects (in 506the repository, index, and working tree), commands that interrogate and 507compare objects, and commands that move objects and references between 508repositories. 509 510 511Manipulation commands 512~~~~~~~~~~~~~~~~~~~~~ 513 514include::cmds-plumbingmanipulators.txt[] 515 516 517Interrogation commands 518~~~~~~~~~~~~~~~~~~~~~~ 519 520include::cmds-plumbinginterrogators.txt[] 521 522In general, the interrogate commands do not touch the files in 523the working tree. 524 525 526Synching repositories 527~~~~~~~~~~~~~~~~~~~~~ 528 529include::cmds-synchingrepositories.txt[] 530 531The following are helper commands used by the above; end users 532typically do not use them directly. 533 534include::cmds-synchelpers.txt[] 535 536 537Internal helper commands 538~~~~~~~~~~~~~~~~~~~~~~~~ 539 540These are internal helper commands used by other commands; end 541users typically do not use them directly. 542 543include::cmds-purehelpers.txt[] 544 545 546Configuration Mechanism 547----------------------- 548 549Git uses a simple text format to store customizations that are per 550repository and are per user. Such a configuration file may look 551like this: 552 553------------ 554# 555# A '#' or ';' character indicates a comment. 556# 557 558; core variables 559[core] 560 ; Don't trust file modes 561 filemode = false 562 563; user identity 564[user] 565 name = "Junio C Hamano" 566 email = "gitster@pobox.com" 567 568------------ 569 570Various commands read from the configuration file and adjust 571their operation accordingly. See linkgit:git-config[1] for a 572list and more details about the configuration mechanism. 573 574 575Identifier Terminology 576---------------------- 577<object>:: 578 Indicates the object name for any type of object. 579 580<blob>:: 581 Indicates a blob object name. 582 583<tree>:: 584 Indicates a tree object name. 585 586<commit>:: 587 Indicates a commit object name. 588 589<tree-ish>:: 590 Indicates a tree, commit or tag object name. A 591 command that takes a <tree-ish> argument ultimately wants to 592 operate on a <tree> object but automatically dereferences 593 <commit> and <tag> objects that point at a <tree>. 594 595<commit-ish>:: 596 Indicates a commit or tag object name. A 597 command that takes a <commit-ish> argument ultimately wants to 598 operate on a <commit> object but automatically dereferences 599 <tag> objects that point at a <commit>. 600 601<type>:: 602 Indicates that an object type is required. 603 Currently one of: `blob`, `tree`, `commit`, or `tag`. 604 605<file>:: 606 Indicates a filename - almost always relative to the 607 root of the tree structure `GIT_INDEX_FILE` describes. 608 609Symbolic Identifiers 610-------------------- 611Any Git command accepting any <object> can also use the following 612symbolic notation: 613 614HEAD:: 615 indicates the head of the current branch. 616 617<tag>:: 618 a valid tag 'name' 619 (i.e. a `refs/tags/<tag>` reference). 620 621<head>:: 622 a valid head 'name' 623 (i.e. a `refs/heads/<head>` reference). 624 625For a more complete list of ways to spell object names, see 626"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7]. 627 628 629File/Directory Structure 630------------------------ 631 632Please see the linkgit:gitrepository-layout[5] document. 633 634Read linkgit:githooks[5] for more details about each hook. 635 636Higher level SCMs may provide and manage additional information in the 637`$GIT_DIR`. 638 639 640Terminology 641----------- 642Please see linkgit:gitglossary[7]. 643 644 645Environment Variables 646--------------------- 647Various Git commands use the following environment variables: 648 649The Git Repository 650~~~~~~~~~~~~~~~~~~ 651These environment variables apply to 'all' core Git commands. Nb: it 652is worth noting that they may be used/overridden by SCMS sitting above 653Git so take care if using Cogito etc. 654 655'GIT_INDEX_FILE':: 656 This environment allows the specification of an alternate 657 index file. If not specified, the default of `$GIT_DIR/index` 658 is used. 659 660'GIT_OBJECT_DIRECTORY':: 661 If the object storage directory is specified via this 662 environment variable then the sha1 directories are created 663 underneath - otherwise the default `$GIT_DIR/objects` 664 directory is used. 665 666'GIT_ALTERNATE_OBJECT_DIRECTORIES':: 667 Due to the immutable nature of Git objects, old objects can be 668 archived into shared, read-only directories. This variable 669 specifies a ":" separated (on Windows ";" separated) list 670 of Git object directories which can be used to search for Git 671 objects. New objects will not be written to these directories. 672 673'GIT_DIR':: 674 If the 'GIT_DIR' environment variable is set then it 675 specifies a path to use instead of the default `.git` 676 for the base of the repository. 677 The '--git-dir' command-line option also sets this value. 678 679'GIT_WORK_TREE':: 680 Set the path to the working tree. The value will not be 681 used in combination with repositories found automatically in 682 a .git directory (i.e. $GIT_DIR is not set). 683 This can also be controlled by the '--work-tree' command line 684 option and the core.worktree configuration variable. 685 686'GIT_NAMESPACE':: 687 Set the Git namespace; see linkgit:gitnamespaces[7] for details. 688 The '--namespace' command-line option also sets this value. 689 690'GIT_CEILING_DIRECTORIES':: 691 This should be a colon-separated list of absolute paths. If 692 set, it is a list of directories that Git should not chdir up 693 into while looking for a repository directory (useful for 694 excluding slow-loading network directories). It will not 695 exclude the current working directory or a GIT_DIR set on the 696 command line or in the environment. Normally, Git has to read 697 the entries in this list and resolve any symlink that 698 might be present in order to compare them with the current 699 directory. However, if even this access is slow, you 700 can add an empty entry to the list to tell Git that the 701 subsequent entries are not symlinks and needn't be resolved; 702 e.g., 703 'GIT_CEILING_DIRECTORIES=/maybe/symlink::/very/slow/non/symlink'. 704 705'GIT_DISCOVERY_ACROSS_FILESYSTEM':: 706 When run in a directory that does not have ".git" repository 707 directory, Git tries to find such a directory in the parent 708 directories to find the top of the working tree, but by default it 709 does not cross filesystem boundaries. This environment variable 710 can be set to true to tell Git not to stop at filesystem 711 boundaries. Like 'GIT_CEILING_DIRECTORIES', this will not affect 712 an explicit repository directory set via 'GIT_DIR' or on the 713 command line. 714 715Git Commits 716~~~~~~~~~~~ 717'GIT_AUTHOR_NAME':: 718'GIT_AUTHOR_EMAIL':: 719'GIT_AUTHOR_DATE':: 720'GIT_COMMITTER_NAME':: 721'GIT_COMMITTER_EMAIL':: 722'GIT_COMMITTER_DATE':: 723'EMAIL':: 724 see linkgit:git-commit-tree[1] 725 726Git Diffs 727~~~~~~~~~ 728'GIT_DIFF_OPTS':: 729 Only valid setting is "--unified=??" or "-u??" to set the 730 number of context lines shown when a unified diff is created. 731 This takes precedence over any "-U" or "--unified" option 732 value passed on the Git diff command line. 733 734'GIT_EXTERNAL_DIFF':: 735 When the environment variable 'GIT_EXTERNAL_DIFF' is set, the 736 program named by it is called, instead of the diff invocation 737 described above. For a path that is added, removed, or modified, 738 'GIT_EXTERNAL_DIFF' is called with 7 parameters: 739 740 path old-file old-hex old-mode new-file new-hex new-mode 741+ 742where: 743 744 <old|new>-file:: are files GIT_EXTERNAL_DIFF can use to read the 745 contents of <old|new>, 746 <old|new>-hex:: are the 40-hexdigit SHA-1 hashes, 747 <old|new>-mode:: are the octal representation of the file modes. 748+ 749The file parameters can point at the user's working file 750(e.g. `new-file` in "git-diff-files"), `/dev/null` (e.g. `old-file` 751when a new file is added), or a temporary file (e.g. `old-file` in the 752index). 'GIT_EXTERNAL_DIFF' should not worry about unlinking the 753temporary file --- it is removed when 'GIT_EXTERNAL_DIFF' exits. 754+ 755For a path that is unmerged, 'GIT_EXTERNAL_DIFF' is called with 1 756parameter, <path>. 757 758other 759~~~~~ 760'GIT_MERGE_VERBOSITY':: 761 A number controlling the amount of output shown by 762 the recursive merge strategy. Overrides merge.verbosity. 763 See linkgit:git-merge[1] 764 765'GIT_PAGER':: 766 This environment variable overrides `$PAGER`. If it is set 767 to an empty string or to the value "cat", Git will not launch 768 a pager. See also the `core.pager` option in 769 linkgit:git-config[1]. 770 771'GIT_EDITOR':: 772 This environment variable overrides `$EDITOR` and `$VISUAL`. 773 It is used by several Git commands when, on interactive mode, 774 an editor is to be launched. See also linkgit:git-var[1] 775 and the `core.editor` option in linkgit:git-config[1]. 776 777'GIT_SSH':: 778 If this environment variable is set then 'git fetch' 779 and 'git push' will use this command instead 780 of 'ssh' when they need to connect to a remote system. 781 The '$GIT_SSH' command will be given exactly two or 782 four arguments: the 'username@host' (or just 'host') 783 from the URL and the shell command to execute on that 784 remote system, optionally preceded by '-p' (literally) and 785 the 'port' from the URL when it specifies something other 786 than the default SSH port. 787+ 788To pass options to the program that you want to list in GIT_SSH 789you will need to wrap the program and options into a shell script, 790then set GIT_SSH to refer to the shell script. 791+ 792Usually it is easier to configure any desired options through your 793personal `.ssh/config` file. Please consult your ssh documentation 794for further details. 795 796'GIT_ASKPASS':: 797 If this environment variable is set, then Git commands which need to 798 acquire passwords or passphrases (e.g. for HTTP or IMAP authentication) 799 will call this program with a suitable prompt as command line argument 800 and read the password from its STDOUT. See also the 'core.askpass' 801 option in linkgit:git-config[1]. 802 803'GIT_CONFIG_NOSYSTEM':: 804 Whether to skip reading settings from the system-wide 805 `$(prefix)/etc/gitconfig` file. This environment variable can 806 be used along with `$HOME` and `$XDG_CONFIG_HOME` to create a 807 predictable environment for a picky script, or you can set it 808 temporarily to avoid using a buggy `/etc/gitconfig` file while 809 waiting for someone with sufficient permissions to fix it. 810 811'GIT_FLUSH':: 812 If this environment variable is set to "1", then commands such 813 as 'git blame' (in incremental mode), 'git rev-list', 'git log', 814 and 'git whatchanged' will force a flush of the output stream 815 after each commit-oriented record have been flushed. If this 816 variable is set to "0", the output of these commands will be done 817 using completely buffered I/O. If this environment variable is 818 not set, Git will choose buffered or record-oriented flushing 819 based on whether stdout appears to be redirected to a file or not. 820 821'GIT_TRACE':: 822 If this variable is set to "1", "2" or "true" (comparison 823 is case insensitive), Git will print `trace:` messages on 824 stderr telling about alias expansion, built-in command 825 execution and external command execution. 826 If this variable is set to an integer value greater than 1 827 and lower than 10 (strictly) then Git will interpret this 828 value as an open file descriptor and will try to write the 829 trace messages into this file descriptor. 830 Alternatively, if this variable is set to an absolute path 831 (starting with a '/' character), Git will interpret this 832 as a file path and will try to write the trace messages 833 into it. 834 835GIT_LITERAL_PATHSPECS:: 836 Setting this variable to `1` will cause Git to treat all 837 pathspecs literally, rather than as glob patterns. For example, 838 running `GIT_LITERAL_PATHSPECS=1 git log -- '*.c'` will search 839 for commits that touch the path `*.c`, not any paths that the 840 glob `*.c` matches. You might want this if you are feeding 841 literal paths to Git (e.g., paths previously given to you by 842 `git ls-tree`, `--raw` diff output, etc). 843 844 845Discussion[[Discussion]] 846------------------------ 847 848More detail on the following is available from the 849link:user-manual.html#git-concepts[Git concepts chapter of the 850user-manual] and linkgit:gitcore-tutorial[7]. 851 852A Git project normally consists of a working directory with a ".git" 853subdirectory at the top level. The .git directory contains, among other 854things, a compressed object database representing the complete history 855of the project, an "index" file which links that history to the current 856contents of the working tree, and named pointers into that history such 857as tags and branch heads. 858 859The object database contains objects of three main types: blobs, which 860hold file data; trees, which point to blobs and other trees to build up 861directory hierarchies; and commits, which each reference a single tree 862and some number of parent commits. 863 864The commit, equivalent to what other systems call a "changeset" or 865"version", represents a step in the project's history, and each parent 866represents an immediately preceding step. Commits with more than one 867parent represent merges of independent lines of development. 868 869All objects are named by the SHA-1 hash of their contents, normally 870written as a string of 40 hex digits. Such names are globally unique. 871The entire history leading up to a commit can be vouched for by signing 872just that commit. A fourth object type, the tag, is provided for this 873purpose. 874 875When first created, objects are stored in individual files, but for 876efficiency may later be compressed together into "pack files". 877 878Named pointers called refs mark interesting points in history. A ref 879may contain the SHA-1 name of an object or the name of another ref. Refs 880with names beginning `ref/head/` contain the SHA-1 name of the most 881recent commit (or "head") of a branch under development. SHA-1 names of 882tags of interest are stored under `ref/tags/`. A special ref named 883`HEAD` contains the name of the currently checked-out branch. 884 885The index file is initialized with a list of all paths and, for each 886path, a blob object and a set of attributes. The blob object represents 887the contents of the file as of the head of the current branch. The 888attributes (last modified time, size, etc.) are taken from the 889corresponding file in the working tree. Subsequent changes to the 890working tree can be found by comparing these attributes. The index may 891be updated with new content, and new commits may be created from the 892content stored in the index. 893 894The index is also capable of storing multiple entries (called "stages") 895for a given pathname. These stages are used to hold the various 896unmerged version of a file when a merge is in progress. 897 898FURTHER DOCUMENTATION 899--------------------- 900 901See the references in the "description" section to get started 902using Git. The following is probably more detail than necessary 903for a first-time user. 904 905The link:user-manual.html#git-concepts[Git concepts chapter of the 906user-manual] and linkgit:gitcore-tutorial[7] both provide 907introductions to the underlying Git architecture. 908 909See linkgit:gitworkflows[7] for an overview of recommended workflows. 910 911See also the link:howto-index.html[howto] documents for some useful 912examples. 913 914The internals are documented in the 915link:technical/api-index.html[Git API documentation]. 916 917Users migrating from CVS may also want to 918read linkgit:gitcvs-migration[7]. 919 920 921Authors 922------- 923Git was started by Linus Torvalds, and is currently maintained by Junio 924C Hamano. Numerous contributions have come from the Git mailing list 925<git@vger.kernel.org>. http://www.ohloh.net/p/git/contributors/summary 926gives you a more complete list of contributors. 927 928If you have a clone of git.git itself, the 929output of linkgit:git-shortlog[1] and linkgit:git-blame[1] can show you 930the authors for specific parts of the project. 931 932Reporting Bugs 933-------------- 934 935Report bugs to the Git mailing list <git@vger.kernel.org> where the 936development and maintenance is primarily done. You do not have to be 937subscribed to the list to send a message there. 938 939SEE ALSO 940-------- 941linkgit:gittutorial[7], linkgit:gittutorial-2[7], 942link:everyday.html[Everyday Git], linkgit:gitcvs-migration[7], 943linkgit:gitglossary[7], linkgit:gitcore-tutorial[7], 944linkgit:gitcli[7], link:user-manual.html[The Git User's Manual], 945linkgit:gitworkflows[7] 946 947GIT 948--- 949Part of the linkgit:git[1] suite