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