]>
Commit | Line | Data |
---|---|---|
7984eabe | 1 | git(7) |
2cf565c5 | 2 | ====== |
2cf565c5 DG |
3 | |
4 | NAME | |
5 | ---- | |
6 | git - the stupid content tracker | |
7 | ||
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
6acbcb92 JS |
11 | 'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] |
12 | [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS] | |
2cf565c5 DG |
13 | |
14 | DESCRIPTION | |
15 | ----------- | |
23091e95 BF |
16 | Git is a fast, scalable, distributed revision control system with an |
17 | unusually rich command set that provides both high-level operations | |
18 | and full access to internals. | |
19 | ||
20 | See this link:tutorial.html[tutorial] to get started, then see | |
21 | link:everyday.html[Everyday Git] for a useful minimum set of commands, and | |
22 | "man git-commandname" for documentation of each command. CVS users may | |
23 | also want to read link:cvs-migration.html[CVS migration]. | |
cb22bc44 | 24 | |
4514ad4f PB |
25 | The COMMAND is either a name of a Git command (see below) or an alias |
26 | as defined in the configuration file (see gitlink:git-repo-config[1]). | |
27 | ||
cb22bc44 AE |
28 | OPTIONS |
29 | ------- | |
30 | --version:: | |
a87cd02c | 31 | Prints the git suite version that the 'git' program came from. |
cb22bc44 AE |
32 | |
33 | --help:: | |
a87cd02c FK |
34 | Prints the synopsis and a list of the most commonly used |
35 | commands. If a git command is named this option will bring up | |
36 | the man-page for that command. If the option '--all' or '-a' is | |
37 | given then all available commands are printed. | |
cb22bc44 AE |
38 | |
39 | --exec-path:: | |
a87cd02c | 40 | Path to wherever your core git programs are installed. |
cb22bc44 AE |
41 | This can also be controlled by setting the GIT_EXEC_PATH |
42 | environment variable. If no path is given 'git' will print | |
43 | the current setting and then exit. | |
44 | ||
6acbcb92 JS |
45 | -p|--paginate:: |
46 | Pipe all output into 'less' (or if set, $PAGER). | |
47 | ||
48 | --git-dir=<path>:: | |
49 | Set the path to the repository. This can also be controlled by | |
50 | setting the GIT_DIR environment variable. | |
51 | ||
52 | --bare:: | |
53 | Same as --git-dir=`pwd`. | |
9755afbd | 54 | |
23091e95 BF |
55 | FURTHER DOCUMENTATION |
56 | --------------------- | |
9755afbd | 57 | |
23091e95 BF |
58 | See the references above to get started using git. The following is |
59 | probably more detail than necessary for a first-time user. | |
8db9307c | 60 | |
23091e95 BF |
61 | The <<Discussion,Discussion>> section below and the |
62 | link:core-tutorial.html[Core tutorial] both provide introductions to the | |
63 | underlying git architecture. | |
e6fc2346 | 64 | |
23091e95 BF |
65 | See also the link:howto-index.html[howto] documents for some useful |
66 | examples. | |
9755afbd | 67 | |
23091e95 BF |
68 | GIT COMMANDS |
69 | ------------ | |
9755afbd | 70 | |
23091e95 BF |
71 | We divide git into high level ("porcelain") commands and low level |
72 | ("plumbing") commands. | |
8b15e2fb | 73 | |
23091e95 BF |
74 | Low-level commands (plumbing) |
75 | ----------------------------- | |
e6fc2346 | 76 | |
23091e95 BF |
77 | Although git includes its |
78 | own porcelain layer, its low-level commands are sufficient to support | |
79 | development of alternative porcelains. Developers of such porcelains | |
80 | might start by reading about gitlink:git-update-index[1] and | |
81 | gitlink:git-read-tree[1]. | |
2cf565c5 | 82 | |
23091e95 BF |
83 | We divide the low-level commands into commands that manipulate objects (in |
84 | the repository, index, and working tree), commands that interrogate and | |
85 | compare objects, and commands that move objects and references between | |
86 | repositories. | |
204ee6a9 | 87 | |
2cf565c5 DG |
88 | Manipulation commands |
89 | ~~~~~~~~~~~~~~~~~~~~~ | |
a7154e91 | 90 | gitlink:git-apply[1]:: |
f85a4191 JH |
91 | Reads a "diff -up1" or git generated patch file and |
92 | applies it to the working tree. | |
93 | ||
a7154e91 | 94 | gitlink:git-checkout-index[1]:: |
2fa090b6 | 95 | Copy files from the index to the working tree. |
2cf565c5 | 96 | |
a7154e91 | 97 | gitlink:git-commit-tree[1]:: |
2fa090b6 | 98 | Creates a new commit object. |
2cf565c5 | 99 | |
a7154e91 | 100 | gitlink:git-hash-object[1]:: |
f85a4191 JH |
101 | Computes the object ID from a file. |
102 | ||
a52e4ef8 | 103 | gitlink:git-index-pack[1]:: |
2fa090b6 | 104 | Build pack idx file for an existing packed archive. |
9cf6d335 | 105 | |
a7154e91 | 106 | gitlink:git-init-db[1]:: |
2fa090b6 JH |
107 | Creates an empty git object database, or reinitialize an |
108 | existing one. | |
2cf565c5 | 109 | |
a7154e91 | 110 | gitlink:git-merge-index[1]:: |
2fa090b6 | 111 | Runs a merge for files needing merging. |
2cf565c5 | 112 | |
a7154e91 | 113 | gitlink:git-mktag[1]:: |
2fa090b6 | 114 | Creates a tag object. |
2cf565c5 | 115 | |
c16e30c0 JH |
116 | gitlink:git-mktree[1]:: |
117 | Build a tree-object from ls-tree formatted text. | |
118 | ||
a7154e91 | 119 | gitlink:git-pack-objects[1]:: |
f85a4191 JH |
120 | Creates a packed archive of objects. |
121 | ||
a7154e91 | 122 | gitlink:git-prune-packed[1]:: |
f85a4191 JH |
123 | Remove extra objects that are already in pack files. |
124 | ||
a7154e91 | 125 | gitlink:git-read-tree[1]:: |
2fa090b6 | 126 | Reads tree information into the index. |
2cf565c5 | 127 | |
ee72aeaf JS |
128 | gitlink:git-repo-config[1]:: |
129 | Get and set options in .git/config. | |
130 | ||
a7154e91 | 131 | gitlink:git-unpack-objects[1]:: |
f85a4191 JH |
132 | Unpacks objects out of a packed archive. |
133 | ||
a7154e91 | 134 | gitlink:git-update-index[1]:: |
2fa090b6 | 135 | Registers files in the working tree to the index. |
2cf565c5 | 136 | |
a7154e91 | 137 | gitlink:git-write-tree[1]:: |
2fa090b6 | 138 | Creates a tree from the index. |
2cf565c5 | 139 | |
e31bb3bb | 140 | |
2cf565c5 DG |
141 | Interrogation commands |
142 | ~~~~~~~~~~~~~~~~~~~~~~ | |
f85a4191 | 143 | |
a7154e91 | 144 | gitlink:git-cat-file[1]:: |
2fa090b6 | 145 | Provide content or type/size information for repository objects. |
2cf565c5 | 146 | |
c06818e2 JH |
147 | gitlink:git-describe[1]:: |
148 | Show the most recent tag that is reachable from a commit. | |
149 | ||
a7154e91 | 150 | gitlink:git-diff-index[1]:: |
2fa090b6 | 151 | Compares content and mode of blobs between the index and repository. |
2cf565c5 | 152 | |
a7154e91 | 153 | gitlink:git-diff-files[1]:: |
2fa090b6 | 154 | Compares files in the working tree and the index. |
2cf565c5 | 155 | |
a7154e91 | 156 | gitlink:git-diff-stages[1]:: |
2fa090b6 | 157 | Compares two "merge stages" in the index. |
83db04ff | 158 | |
a7154e91 | 159 | gitlink:git-diff-tree[1]:: |
2fa090b6 | 160 | Compares the content and mode of blobs found via two tree objects. |
f85a4191 | 161 | |
a7154e91 | 162 | gitlink:git-fsck-objects[1]:: |
2fa090b6 | 163 | Verifies the connectivity and validity of the objects in the database. |
2cf565c5 | 164 | |
a7154e91 | 165 | gitlink:git-ls-files[1]:: |
2fa090b6 | 166 | Information about files in the index and the working tree. |
2cf565c5 | 167 | |
a7154e91 | 168 | gitlink:git-ls-tree[1]:: |
2fa090b6 | 169 | Displays a tree object in human readable form. |
2cf565c5 | 170 | |
a7154e91 | 171 | gitlink:git-merge-base[1]:: |
2fa090b6 | 172 | Finds as good common ancestors as possible for a merge. |
2cf565c5 | 173 | |
a60d2d8f | 174 | gitlink:git-name-rev[1]:: |
2fa090b6 | 175 | Find symbolic names for given revs. |
a60d2d8f | 176 | |
76cead39 JH |
177 | gitlink:git-pack-redundant[1]:: |
178 | Find redundant pack files. | |
179 | ||
a7154e91 | 180 | gitlink:git-rev-list[1]:: |
2fa090b6 | 181 | Lists commit objects in reverse chronological order. |
2cf565c5 | 182 | |
a7154e91 | 183 | gitlink:git-show-index[1]:: |
f85a4191 JH |
184 | Displays contents of a pack idx file. |
185 | ||
a7154e91 | 186 | gitlink:git-tar-tree[1]:: |
2fa090b6 | 187 | Creates a tar archive of the files in the named tree object. |
2cf565c5 | 188 | |
a7154e91 | 189 | gitlink:git-unpack-file[1]:: |
2fa090b6 | 190 | Creates a temporary file with a blob's contents. |
2cf565c5 | 191 | |
a7154e91 | 192 | gitlink:git-var[1]:: |
2fa090b6 | 193 | Displays a git logical variable. |
aed022ab | 194 | |
a7154e91 | 195 | gitlink:git-verify-pack[1]:: |
2fa090b6 | 196 | Validates packed git archive files. |
f9253394 | 197 | |
2fa090b6 JH |
198 | In general, the interrogate commands do not touch the files in |
199 | the working tree. | |
2cf565c5 DG |
200 | |
201 | ||
0c04094b JH |
202 | Synching repositories |
203 | ~~~~~~~~~~~~~~~~~~~~~ | |
204 | ||
a7154e91 | 205 | gitlink:git-fetch-pack[1]:: |
2fa090b6 JH |
206 | Updates from a remote repository (engine for ssh and |
207 | local transport). | |
f85a4191 | 208 | |
a7154e91 | 209 | gitlink:git-http-fetch[1]:: |
2fa090b6 JH |
210 | Downloads a remote git repository via HTTP by walking |
211 | commit chain. | |
204ee6a9 | 212 | |
a7154e91 | 213 | gitlink:git-local-fetch[1]:: |
2fa090b6 JH |
214 | Duplicates another git repository on a local system by |
215 | walking commit chain. | |
204ee6a9 | 216 | |
a7154e91 | 217 | gitlink:git-peek-remote[1]:: |
2fa090b6 JH |
218 | Lists references on a remote repository using |
219 | upload-pack protocol (engine for ssh and local | |
220 | transport). | |
2f2de9b4 | 221 | |
a7154e91 | 222 | gitlink:git-receive-pack[1]:: |
2f2de9b4 JH |
223 | Invoked by 'git-send-pack' to receive what is pushed to it. |
224 | ||
a7154e91 | 225 | gitlink:git-send-pack[1]:: |
f85a4191 | 226 | Pushes to a remote repository, intelligently. |
2f2de9b4 | 227 | |
76cead39 JH |
228 | gitlink:git-http-push[1]:: |
229 | Push missing objects using HTTP/DAV. | |
230 | ||
d43367af PB |
231 | gitlink:git-shell[1]:: |
232 | Restricted shell for GIT-only SSH access. | |
233 | ||
a7154e91 | 234 | gitlink:git-ssh-fetch[1]:: |
2fa090b6 JH |
235 | Pulls from a remote repository over ssh connection by |
236 | walking commit chain. | |
508e67ab | 237 | |
a7154e91 | 238 | gitlink:git-ssh-upload[1]:: |
2fa090b6 | 239 | Helper "server-side" program used by git-ssh-fetch. |
2f2de9b4 | 240 | |
a7154e91 | 241 | gitlink:git-update-server-info[1]:: |
61e3ef36 JH |
242 | Updates auxiliary information on a dumb server to help |
243 | clients discover references and packs on it. | |
244 | ||
a7154e91 | 245 | gitlink:git-upload-pack[1]:: |
efc7fa53 | 246 | Invoked by 'git-fetch-pack' to push |
f85a4191 JH |
247 | what are asked for. |
248 | ||
34925d35 JH |
249 | gitlink:git-upload-tar[1]:: |
250 | Invoked by 'git-tar-tree --remote' to return the tar | |
251 | archive the other end asked for. | |
252 | ||
2f2de9b4 | 253 | |
23091e95 BF |
254 | High-level commands (porcelain) |
255 | ------------------------------- | |
256 | ||
257 | We separate the porcelain commands into the main commands and some | |
258 | ancillary user utilities. | |
259 | ||
260 | Main porcelain commands | |
261 | ~~~~~~~~~~~~~~~~~~~~~~~ | |
905197de | 262 | |
a7154e91 | 263 | gitlink:git-add[1]:: |
2fa090b6 | 264 | Add paths to the index. |
905197de | 265 | |
8548ea8d PB |
266 | gitlink:git-am[1]:: |
267 | Apply patches from a mailbox, but cooler. | |
268 | ||
a7154e91 | 269 | gitlink:git-applymbox[1]:: |
2fa090b6 | 270 | Apply patches from a mailbox, original version by Linus. |
f85a4191 | 271 | |
a7154e91 | 272 | gitlink:git-bisect[1]:: |
2fa090b6 | 273 | Find the change that introduced a bug by binary search. |
f85a4191 | 274 | |
a7154e91 | 275 | gitlink:git-branch[1]:: |
905197de JH |
276 | Create and Show branches. |
277 | ||
a7154e91 | 278 | gitlink:git-checkout[1]:: |
452ce291 JH |
279 | Checkout and switch to a branch. |
280 | ||
a7154e91 | 281 | gitlink:git-cherry-pick[1]:: |
f85a4191 | 282 | Cherry-pick the effect of an existing commit. |
3f971fc4 | 283 | |
c16e30c0 JH |
284 | gitlink:git-clean[1]:: |
285 | Remove untracked files from the working tree. | |
286 | ||
a7154e91 | 287 | gitlink:git-clone[1]:: |
f85a4191 | 288 | Clones a repository into a new directory. |
3f971fc4 | 289 | |
a7154e91 | 290 | gitlink:git-commit[1]:: |
f85a4191 | 291 | Record changes to the repository. |
3f971fc4 | 292 | |
a7154e91 | 293 | gitlink:git-diff[1]:: |
2aba319a | 294 | Show changes between commits, commit and working tree, etc. |
35ef3a4c | 295 | |
a7154e91 | 296 | gitlink:git-fetch[1]:: |
62033318 JH |
297 | Download from a remote repository via various protocols. |
298 | ||
a7154e91 | 299 | gitlink:git-format-patch[1]:: |
2aba319a | 300 | Prepare patches for e-mail submission. |
35ef3a4c | 301 | |
a7154e91 | 302 | gitlink:git-grep[1]:: |
2fa090b6 | 303 | Print lines matching a pattern. |
2aba319a | 304 | |
a7154e91 | 305 | gitlink:git-log[1]:: |
f85a4191 | 306 | Shows commit logs. |
62033318 | 307 | |
a7154e91 | 308 | gitlink:git-ls-remote[1]:: |
f85a4191 | 309 | Shows references in a remote or local repository. |
ab9b3138 | 310 | |
a7154e91 | 311 | gitlink:git-merge[1]:: |
0f69be53 JH |
312 | Grand unified merge driver. |
313 | ||
8548ea8d PB |
314 | gitlink:git-mv[1]:: |
315 | Move or rename a file, a directory, or a symlink. | |
316 | ||
a7154e91 | 317 | gitlink:git-pull[1]:: |
f85a4191 JH |
318 | Fetch from and merge with a remote repository. |
319 | ||
a7154e91 | 320 | gitlink:git-push[1]:: |
ab9b3138 JH |
321 | Update remote refs along with associated objects. |
322 | ||
a7154e91 | 323 | gitlink:git-rebase[1]:: |
2fa090b6 | 324 | Rebase local commits to the updated upstream head. |
62033318 | 325 | |
a7154e91 | 326 | gitlink:git-repack[1]:: |
e31bb3bb JH |
327 | Pack unpacked objects in a repository. |
328 | ||
8389b52b JH |
329 | gitlink:git-rerere[1]:: |
330 | Reuse recorded resolution of conflicted merges. | |
331 | ||
a7154e91 | 332 | gitlink:git-reset[1]:: |
452ce291 JH |
333 | Reset current HEAD to the specified state. |
334 | ||
a7154e91 | 335 | gitlink:git-resolve[1]:: |
f85a4191 | 336 | Merge two commits. |
83db04ff | 337 | |
a7154e91 | 338 | gitlink:git-revert[1]:: |
f85a4191 JH |
339 | Revert an existing commit. |
340 | ||
c16e30c0 JH |
341 | gitlink:git-rm[1]:: |
342 | Remove files from the working tree and from the index. | |
343 | ||
a7154e91 | 344 | gitlink:git-shortlog[1]:: |
f85a4191 JH |
345 | Summarizes 'git log' output. |
346 | ||
55258b5c JL |
347 | gitlink:git-show[1]:: |
348 | Show one commit log and its diff. | |
349 | ||
a7154e91 | 350 | gitlink:git-show-branch[1]:: |
f85a4191 JH |
351 | Show branches and their commits. |
352 | ||
a7154e91 | 353 | gitlink:git-status[1]:: |
f85a4191 | 354 | Shows the working tree status. |
83db04ff | 355 | |
a7154e91 | 356 | gitlink:git-verify-tag[1]:: |
905197de JH |
357 | Check the GPG signature of tag. |
358 | ||
a7154e91 | 359 | gitlink:git-whatchanged[1]:: |
f85a4191 JH |
360 | Shows commit logs and differences they introduce. |
361 | ||
e31bb3bb | 362 | |
90933efb | 363 | Ancillary Commands |
23091e95 | 364 | ~~~~~~~~~~~~~~~~~~ |
2f2de9b4 JH |
365 | Manipulators: |
366 | ||
a7154e91 | 367 | gitlink:git-applypatch[1]:: |
f85a4191 | 368 | Apply one patch extracted from an e-mail. |
905197de | 369 | |
a7154e91 | 370 | gitlink:git-archimport[1]:: |
5077fa9c JH |
371 | Import an arch repository into git. |
372 | ||
a7154e91 | 373 | gitlink:git-convert-objects[1]:: |
2fa090b6 | 374 | Converts old-style git repository. |
2f2de9b4 | 375 | |
a7154e91 | 376 | gitlink:git-cvsimport[1]:: |
f85a4191 JH |
377 | Salvage your data out of another SCM people love to hate. |
378 | ||
76cead39 JH |
379 | gitlink:git-cvsexportcommit[1]:: |
380 | Export a single commit to a CVS checkout. | |
381 | ||
c16e30c0 JH |
382 | gitlink:git-cvsserver[1]:: |
383 | A CVS server emulator for git. | |
384 | ||
0086e2c8 | 385 | gitlink:git-lost-found[1]:: |
04e7ca1a JH |
386 | Recover lost refs that luckily have not yet been pruned. |
387 | ||
a7154e91 | 388 | gitlink:git-merge-one-file[1]:: |
2fa090b6 | 389 | The standard helper program to use with `git-merge-index`. |
204ee6a9 | 390 | |
a7154e91 | 391 | gitlink:git-prune[1]:: |
2fa090b6 | 392 | Prunes all unreachable objects from the object database. |
204ee6a9 | 393 | |
34925d35 JH |
394 | gitlink:git-quiltimport[1]:: |
395 | Applies a quilt patchset onto the current branch. | |
396 | ||
a7154e91 | 397 | gitlink:git-relink[1]:: |
f85a4191 JH |
398 | Hardlink common objects in local repositories. |
399 | ||
8548ea8d PB |
400 | gitlink:git-svnimport[1]:: |
401 | Import a SVN repository into git. | |
402 | ||
a7154e91 | 403 | gitlink:git-sh-setup[1]:: |
f85a4191 JH |
404 | Common git shell script setup code. |
405 | ||
a60d2d8f | 406 | gitlink:git-symbolic-ref[1]:: |
2fa090b6 | 407 | Read and modify symbolic refs. |
a60d2d8f | 408 | |
a7154e91 | 409 | gitlink:git-tag[1]:: |
2fa090b6 | 410 | An example script to create a tag object signed with GPG. |
204ee6a9 | 411 | |
8548ea8d PB |
412 | gitlink:git-update-ref[1]:: |
413 | Update the object name stored in a ref safely. | |
414 | ||
204ee6a9 | 415 | |
90933efb | 416 | Interrogators: |
204ee6a9 | 417 | |
8f2b72a9 JF |
418 | gitlink:git-annotate[1]:: |
419 | Annotate file lines with commit info. | |
420 | ||
421 | gitlink:git-blame[1]:: | |
422 | Blame file lines on commits. | |
423 | ||
8548ea8d PB |
424 | gitlink:git-check-ref-format[1]:: |
425 | Make sure ref name is well formed. | |
426 | ||
a7154e91 | 427 | gitlink:git-cherry[1]:: |
f85a4191 | 428 | Find commits not merged upstream. |
905197de | 429 | |
a7154e91 | 430 | gitlink:git-count-objects[1]:: |
905197de JH |
431 | Count unpacked number of objects and their disk consumption. |
432 | ||
a7154e91 | 433 | gitlink:git-daemon[1]:: |
72e9340c | 434 | A really simple server for git repositories. |
5077fa9c | 435 | |
c16e30c0 JH |
436 | gitlink:git-fmt-merge-msg[1]:: |
437 | Produce a merge commit message. | |
438 | ||
a7154e91 | 439 | gitlink:git-get-tar-commit-id[1]:: |
5077fa9c JH |
440 | Extract commit ID from an archive created using git-tar-tree. |
441 | ||
c16e30c0 JH |
442 | gitlink:git-imap-send[1]:: |
443 | Dump a mailbox from stdin into an imap folder. | |
444 | ||
a7154e91 | 445 | gitlink:git-mailinfo[1]:: |
2fa090b6 JH |
446 | Extracts patch and authorship information from a single |
447 | e-mail message, optionally transliterating the commit | |
448 | message into utf-8. | |
f85a4191 | 449 | |
a7154e91 | 450 | gitlink:git-mailsplit[1]:: |
2fa090b6 JH |
451 | A stupid program to split UNIX mbox format mailbox into |
452 | individual pieces of e-mail. | |
f85a4191 | 453 | |
c16e30c0 JH |
454 | gitlink:git-merge-tree[1]:: |
455 | Show three-way merge without touching index. | |
456 | ||
a7154e91 | 457 | gitlink:git-patch-id[1]:: |
f85a4191 | 458 | Compute unique ID for a patch. |
204ee6a9 | 459 | |
a7154e91 | 460 | gitlink:git-parse-remote[1]:: |
2fa090b6 | 461 | Routines to help parsing `$GIT_DIR/remotes/` files. |
5077fa9c | 462 | |
a7154e91 | 463 | gitlink:git-request-pull[1]:: |
215a7ad1 | 464 | git-request-pull. |
5077fa9c | 465 | |
a7154e91 | 466 | gitlink:git-rev-parse[1]:: |
5077fa9c JH |
467 | Pick out and massage parameters. |
468 | ||
a7154e91 | 469 | gitlink:git-send-email[1]:: |
83db04ff | 470 | Send patch e-mails out of "format-patch --mbox" output. |
204ee6a9 | 471 | |
c1fe2fe4 | 472 | gitlink:git-symbolic-ref[1]:: |
8548ea8d PB |
473 | Read and modify symbolic refs. |
474 | ||
a7154e91 | 475 | gitlink:git-stripspace[1]:: |
35ef3a4c | 476 | Filter out empty lines. |
7fc9d69f | 477 | |
7fc9d69f | 478 | |
35ef3a4c JH |
479 | Commands not yet documented |
480 | --------------------------- | |
7fc9d69f | 481 | |
a7154e91 | 482 | gitlink:gitk[1]:: |
2fa090b6 | 483 | The gitk repository browser. |
7fc9d69f JH |
484 | |
485 | ||
5773c9f2 JH |
486 | Configuration Mechanism |
487 | ----------------------- | |
488 | ||
2fa090b6 | 489 | Starting from 0.99.9 (actually mid 0.99.8.GIT), `.git/config` file |
5773c9f2 | 490 | is used to hold per-repository configuration options. It is a |
addf88e4 | 491 | simple text file modeled after `.ini` format familiar to some |
5773c9f2 JH |
492 | people. Here is an example: |
493 | ||
494 | ------------ | |
495 | # | |
2fa090b6 | 496 | # A '#' or ';' character indicates a comment. |
5773c9f2 JH |
497 | # |
498 | ||
499 | ; core variables | |
500 | [core] | |
501 | ; Don't trust file modes | |
502 | filemode = false | |
503 | ||
504 | ; user identity | |
505 | [user] | |
506 | name = "Junio C Hamano" | |
507 | email = "junkio@twinsun.com" | |
508 | ||
509 | ------------ | |
510 | ||
511 | Various commands read from the configuration file and adjust | |
512 | their operation accordingly. | |
513 | ||
514 | ||
6c84e2e0 | 515 | Identifier Terminology |
2cf565c5 DG |
516 | ---------------------- |
517 | <object>:: | |
2fa090b6 | 518 | Indicates the object name for any type of object. |
2cf565c5 DG |
519 | |
520 | <blob>:: | |
2fa090b6 | 521 | Indicates a blob object name. |
2cf565c5 DG |
522 | |
523 | <tree>:: | |
2fa090b6 | 524 | Indicates a tree object name. |
2cf565c5 DG |
525 | |
526 | <commit>:: | |
2fa090b6 | 527 | Indicates a commit object name. |
2cf565c5 DG |
528 | |
529 | <tree-ish>:: | |
2fa090b6 | 530 | Indicates a tree, commit or tag object name. A |
6c84e2e0 DG |
531 | command that takes a <tree-ish> argument ultimately wants to |
532 | operate on a <tree> object but automatically dereferences | |
533 | <commit> and <tag> objects that point at a <tree>. | |
2cf565c5 DG |
534 | |
535 | <type>:: | |
536 | Indicates that an object type is required. | |
2fa090b6 | 537 | Currently one of: `blob`, `tree`, `commit`, or `tag`. |
2cf565c5 DG |
538 | |
539 | <file>:: | |
2fa090b6 JH |
540 | Indicates a filename - almost always relative to the |
541 | root of the tree structure `GIT_INDEX_FILE` describes. | |
2cf565c5 | 542 | |
c1bdacf9 DG |
543 | Symbolic Identifiers |
544 | -------------------- | |
90933efb | 545 | Any git command accepting any <object> can also use the following |
6c84e2e0 | 546 | symbolic notation: |
c1bdacf9 DG |
547 | |
548 | HEAD:: | |
2fa090b6 JH |
549 | indicates the head of the current branch (i.e. the |
550 | contents of `$GIT_DIR/HEAD`). | |
551 | ||
c1bdacf9 | 552 | <tag>:: |
2fa090b6 JH |
553 | a valid tag 'name' |
554 | (i.e. the contents of `$GIT_DIR/refs/tags/<tag>`). | |
555 | ||
c1bdacf9 | 556 | <head>:: |
2fa090b6 JH |
557 | a valid head 'name' |
558 | (i.e. the contents of `$GIT_DIR/refs/heads/<head>`). | |
559 | ||
c1bdacf9 DG |
560 | |
561 | File/Directory Structure | |
562 | ------------------------ | |
c1bdacf9 | 563 | |
a1d4aa74 | 564 | Please see link:repository-layout.html[repository layout] document. |
c1bdacf9 | 565 | |
6250ad1e JL |
566 | Read link:hooks.html[hooks] for more details about each hook. |
567 | ||
c1bdacf9 | 568 | Higher level SCMs may provide and manage additional information in the |
2fa090b6 | 569 | `$GIT_DIR`. |
c1bdacf9 | 570 | |
a1d4aa74 | 571 | |
2cf565c5 DG |
572 | Terminology |
573 | ----------- | |
1bff6490 | 574 | Please see link:glossary.html[glossary] document. |
2cf565c5 DG |
575 | |
576 | ||
577 | Environment Variables | |
578 | --------------------- | |
579 | Various git commands use the following environment variables: | |
580 | ||
c1bdacf9 DG |
581 | The git Repository |
582 | ~~~~~~~~~~~~~~~~~~ | |
583 | These environment variables apply to 'all' core git commands. Nb: it | |
584 | is worth noting that they may be used/overridden by SCMS sitting above | |
2fa090b6 | 585 | git so take care if using Cogito etc. |
c1bdacf9 DG |
586 | |
587 | 'GIT_INDEX_FILE':: | |
588 | This environment allows the specification of an alternate | |
5f3aa197 LS |
589 | index file. If not specified, the default of `$GIT_DIR/index` |
590 | is used. | |
c1bdacf9 DG |
591 | |
592 | 'GIT_OBJECT_DIRECTORY':: | |
593 | If the object storage directory is specified via this | |
594 | environment variable then the sha1 directories are created | |
595 | underneath - otherwise the default `$GIT_DIR/objects` | |
596 | directory is used. | |
597 | ||
598 | 'GIT_ALTERNATE_OBJECT_DIRECTORIES':: | |
599 | Due to the immutable nature of git objects, old objects can be | |
600 | archived into shared, read-only directories. This variable | |
90933efb | 601 | specifies a ":" separated list of git object directories which |
c1bdacf9 DG |
602 | can be used to search for git objects. New objects will not be |
603 | written to these directories. | |
604 | ||
605 | 'GIT_DIR':: | |
2fa090b6 JH |
606 | If the 'GIT_DIR' environment variable is set then it |
607 | specifies a path to use instead of the default `.git` | |
608 | for the base of the repository. | |
c1bdacf9 DG |
609 | |
610 | git Commits | |
611 | ~~~~~~~~~~~ | |
612 | 'GIT_AUTHOR_NAME':: | |
613 | 'GIT_AUTHOR_EMAIL':: | |
614 | 'GIT_AUTHOR_DATE':: | |
615 | 'GIT_COMMITTER_NAME':: | |
616 | 'GIT_COMMITTER_EMAIL':: | |
a7154e91 | 617 | see gitlink:git-commit-tree[1] |
c1bdacf9 DG |
618 | |
619 | git Diffs | |
620 | ~~~~~~~~~ | |
d81ed1b5 JH |
621 | 'GIT_DIFF_OPTS':: |
622 | 'GIT_EXTERNAL_DIFF':: | |
c1bdacf9 | 623 | see the "generating patches" section in : |
a7154e91 SV |
624 | gitlink:git-diff-index[1]; |
625 | gitlink:git-diff-files[1]; | |
626 | gitlink:git-diff-tree[1] | |
2cf565c5 | 627 | |
575ba9d6 ML |
628 | other |
629 | ~~~~~ | |
630 | 'GIT_TRACE':: | |
631 | If this variable is set git will print `trace:` messages on | |
632 | stderr telling about alias expansion, built-in command | |
633 | execution and external command execution. | |
634 | ||
8db9307c JH |
635 | Discussion[[Discussion]] |
636 | ------------------------ | |
941c9449 | 637 | include::README[] |
6c84e2e0 | 638 | |
cb22bc44 AE |
639 | Authors |
640 | ------- | |
9755afbd JH |
641 | * git's founding father is Linus Torvalds <torvalds@osdl.org>. |
642 | * The current git nurse is Junio C Hamano <junkio@cox.net>. | |
643 | * The git potty was written by Andres Ericsson <ae@op5.se>. | |
644 | * General upbringing is handled by the git-list <git@vger.kernel.org>. | |
2cf565c5 DG |
645 | |
646 | Documentation | |
647 | -------------- | |
9755afbd JH |
648 | The documentation for git suite was started by David Greaves |
649 | <david@dgreaves.com>, and later enhanced greatly by the | |
650 | contributors on the git-list <git@vger.kernel.org>. | |
2cf565c5 DG |
651 | |
652 | GIT | |
653 | --- | |
a7154e91 | 654 | Part of the gitlink:git[7] suite |
2cf565c5 | 655 |