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