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