1GIT(1) Git Manual GIT(1)
2
3
4
6 git - the stupid content tracker
7
9 git [--version] [--help] [-C <path>] [-c <name>=<value>]
10 [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
11 [-p|--paginate|-P|--no-pager] [--no-replace-objects] [--bare]
12 [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
13 [--super-prefix=<path>]
14 <command> [<args>]
15
16
18 Git is a fast, scalable, distributed revision control system with an
19 unusually rich command set that provides both high-level operations and
20 full access to internals.
21
22 See gittutorial(7) to get started, then see giteveryday(7) for a useful
23 minimum set of commands. The Git User’s Manual[1] has a more in-depth
24 introduction.
25
26 After you mastered the basic concepts, you can come back to this page
27 to learn what commands Git offers. You can learn more about individual
28 Git commands with "git help command". gitcli(7) manual page gives you
29 an overview of the command-line command syntax.
30
31 A formatted and hyperlinked copy of the latest Git documentation can be
32 viewed at https://git.github.io/htmldocs/git.html.
33
35 --version
36 Prints the Git suite version that the git program came from.
37
38 --help
39 Prints the synopsis and a list of the most commonly used commands.
40 If the option --all or -a is given then all available commands are
41 printed. If a Git command is named this option will bring up the
42 manual page for that command.
43
44 Other options are available to control how the manual page is
45 displayed. See git-help(1) for more information, because git --help
46 ... is converted internally into git help ....
47
48 -C <path>
49 Run as if git was started in <path> instead of the current working
50 directory. When multiple -C options are given, each subsequent
51 non-absolute -C <path> is interpreted relative to the preceding -C
52 <path>.
53
54 This option affects options that expect path name like --git-dir
55 and --work-tree in that their interpretations of the path names
56 would be made relative to the working directory caused by the -C
57 option. For example the following invocations are equivalent:
58
59 git --git-dir=a.git --work-tree=b -C c status
60 git --git-dir=c/a.git --work-tree=c/b status
61
62 -c <name>=<value>
63 Pass a configuration parameter to the command. The value given will
64 override values from configuration files. The <name> is expected in
65 the same format as listed by git config (subkeys separated by
66 dots).
67
68 Note that omitting the = in git -c foo.bar ... is allowed and sets
69 foo.bar to the boolean true value (just like [foo]bar would in a
70 config file). Including the equals but with an empty value (like
71 git -c foo.bar= ...) sets foo.bar to the empty string which git
72 config --type=bool will convert to false.
73
74 --exec-path[=<path>]
75 Path to wherever your core Git programs are installed. This can
76 also be controlled by setting the GIT_EXEC_PATH environment
77 variable. If no path is given, git will print the current setting
78 and then exit.
79
80 --html-path
81 Print the path, without trailing slash, where Git’s HTML
82 documentation is installed and exit.
83
84 --man-path
85 Print the manpath (see man(1)) for the man pages for this version
86 of Git and exit.
87
88 --info-path
89 Print the path where the Info files documenting this version of Git
90 are installed and exit.
91
92 -p, --paginate
93 Pipe all output into less (or if set, $PAGER) if standard output is
94 a terminal. This overrides the pager.<cmd> configuration options
95 (see the "Configuration Mechanism" section below).
96
97 -P, --no-pager
98 Do not pipe Git output into a pager.
99
100 --git-dir=<path>
101 Set the path to the repository. This can also be controlled by
102 setting the GIT_DIR environment variable. It can be an absolute
103 path or relative path to current working directory.
104
105 --work-tree=<path>
106 Set the path to the working tree. It can be an absolute path or a
107 path relative to the current working directory. This can also be
108 controlled by setting the GIT_WORK_TREE environment variable and
109 the core.worktree configuration variable (see core.worktree in git-
110 config(1) for a more detailed discussion).
111
112 --namespace=<path>
113 Set the Git namespace. See gitnamespaces(7) for more details.
114 Equivalent to setting the GIT_NAMESPACE environment variable.
115
116 --super-prefix=<path>
117 Currently for internal use only. Set a prefix which gives a path
118 from above a repository down to its root. One use is to give
119 submodules context about the superproject that invoked it.
120
121 --bare
122 Treat the repository as a bare repository. If GIT_DIR environment
123 is not set, it is set to the current working directory.
124
125 --no-replace-objects
126 Do not use replacement refs to replace Git objects. See git-
127 replace(1) for more information.
128
129 --literal-pathspecs
130 Treat pathspecs literally (i.e. no globbing, no pathspec magic).
131 This is equivalent to setting the GIT_LITERAL_PATHSPECS environment
132 variable to 1.
133
134 --glob-pathspecs
135 Add "glob" magic to all pathspec. This is equivalent to setting the
136 GIT_GLOB_PATHSPECS environment variable to 1. Disabling globbing on
137 individual pathspecs can be done using pathspec magic ":(literal)"
138
139 --noglob-pathspecs
140 Add "literal" magic to all pathspec. This is equivalent to setting
141 the GIT_NOGLOB_PATHSPECS environment variable to 1. Enabling
142 globbing on individual pathspecs can be done using pathspec magic
143 ":(glob)"
144
145 --icase-pathspecs
146 Add "icase" magic to all pathspec. This is equivalent to setting
147 the GIT_ICASE_PATHSPECS environment variable to 1.
148
149 --no-optional-locks
150 Do not perform optional operations that require locks. This is
151 equivalent to setting the GIT_OPTIONAL_LOCKS to 0.
152
153 --list-cmds=group[,group...]
154 List commands by group. This is an internal/experimental option and
155 may change or be removed in the future. Supported groups are:
156 builtins, parseopt (builtin commands that use parse-options), main
157 (all commands in libexec directory), others (all other commands in
158 $PATH that have git- prefix), list-<category> (see categories in
159 command-list.txt), nohelpers (exclude helper commands), alias and
160 config (retrieve command list from config variable
161 completion.commands)
162
164 We divide Git into high level ("porcelain") commands and low level
165 ("plumbing") commands.
166
168 We separate the porcelain commands into the main commands and some
169 ancillary user utilities.
170
171 Main porcelain commands
172 git-add(1)
173 Add file contents to the index.
174
175 git-am(1)
176 Apply a series of patches from a mailbox.
177
178 git-archive(1)
179 Create an archive of files from a named tree.
180
181 git-bisect(1)
182 Use binary search to find the commit that introduced a bug.
183
184 git-branch(1)
185 List, create, or delete branches.
186
187 git-bundle(1)
188 Move objects and refs by archive.
189
190 git-checkout(1)
191 Switch branches or restore working tree files.
192
193 git-cherry-pick(1)
194 Apply the changes introduced by some existing commits.
195
196 git-citool(1)
197 Graphical alternative to git-commit.
198
199 git-clean(1)
200 Remove untracked files from the working tree.
201
202 git-clone(1)
203 Clone a repository into a new directory.
204
205 git-commit(1)
206 Record changes to the repository.
207
208 git-describe(1)
209 Give an object a human readable name based on an available ref.
210
211 git-diff(1)
212 Show changes between commits, commit and working tree, etc.
213
214 git-fetch(1)
215 Download objects and refs from another repository.
216
217 git-format-patch(1)
218 Prepare patches for e-mail submission.
219
220 git-gc(1)
221 Cleanup unnecessary files and optimize the local repository.
222
223 git-grep(1)
224 Print lines matching a pattern.
225
226 git-gui(1)
227 A portable graphical interface to Git.
228
229 git-init(1)
230 Create an empty Git repository or reinitialize an existing one.
231
232 git-log(1)
233 Show commit logs.
234
235 git-merge(1)
236 Join two or more development histories together.
237
238 git-mv(1)
239 Move or rename a file, a directory, or a symlink.
240
241 git-notes(1)
242 Add or inspect object notes.
243
244 git-pull(1)
245 Fetch from and integrate with another repository or a local branch.
246
247 git-push(1)
248 Update remote refs along with associated objects.
249
250 git-range-diff(1)
251 Compare two commit ranges (e.g. two versions of a branch).
252
253 git-rebase(1)
254 Reapply commits on top of another base tip.
255
256 git-reset(1)
257 Reset current HEAD to the specified state.
258
259 git-revert(1)
260 Revert some existing commits.
261
262 git-rm(1)
263 Remove files from the working tree and from the index.
264
265 git-shortlog(1)
266 Summarize git log output.
267
268 git-show(1)
269 Show various types of objects.
270
271 git-stash(1)
272 Stash the changes in a dirty working directory away.
273
274 git-status(1)
275 Show the working tree status.
276
277 git-submodule(1)
278 Initialize, update or inspect submodules.
279
280 git-tag(1)
281 Create, list, delete or verify a tag object signed with GPG.
282
283 git-worktree(1)
284 Manage multiple working trees.
285
286 gitk(1)
287 The Git repository browser.
288
289 Ancillary Commands
290 Manipulators:
291
292 git-config(1)
293 Get and set repository or global options.
294
295 git-fast-export(1)
296 Git data exporter.
297
298 git-fast-import(1)
299 Backend for fast Git data importers.
300
301 git-filter-branch(1)
302 Rewrite branches.
303
304 git-mergetool(1)
305 Run merge conflict resolution tools to resolve merge conflicts.
306
307 git-pack-refs(1)
308 Pack heads and tags for efficient repository access.
309
310 git-prune(1)
311 Prune all unreachable objects from the object database.
312
313 git-reflog(1)
314 Manage reflog information.
315
316 git-remote(1)
317 Manage set of tracked repositories.
318
319 git-repack(1)
320 Pack unpacked objects in a repository.
321
322 git-replace(1)
323 Create, list, delete refs to replace objects.
324
325 Interrogators:
326
327 git-annotate(1)
328 Annotate file lines with commit information.
329
330 git-blame(1)
331 Show what revision and author last modified each line of a file.
332
333 git-count-objects(1)
334 Count unpacked number of objects and their disk consumption.
335
336 git-difftool(1)
337 Show changes using common diff tools.
338
339 git-fsck(1)
340 Verifies the connectivity and validity of the objects in the
341 database.
342
343 git-help(1)
344 Display help information about Git.
345
346 git-instaweb(1)
347 Instantly browse your working repository in gitweb.
348
349 git-merge-tree(1)
350 Show three-way merge without touching index.
351
352 git-rerere(1)
353 Reuse recorded resolution of conflicted merges.
354
355 git-show-branch(1)
356 Show branches and their commits.
357
358 git-verify-commit(1)
359 Check the GPG signature of commits.
360
361 git-verify-tag(1)
362 Check the GPG signature of tags.
363
364 git-whatchanged(1)
365 Show logs with difference each commit introduces.
366
367 gitweb(1)
368 Git web interface (web frontend to Git repositories).
369
370 Interacting with Others
371 These commands are to interact with foreign SCM and with other people
372 via patch over e-mail.
373
374 git-cvsexportcommit(1)
375 Export a single commit to a CVS checkout.
376
377 git-cvsimport(1)
378 Salvage your data out of another SCM people love to hate.
379
380 git-cvsserver(1)
381 A CVS server emulator for Git.
382
383 git-imap-send(1)
384 Send a collection of patches from stdin to an IMAP folder.
385
386 git-p4(1)
387 Import from and submit to Perforce repositories.
388
389 git-quiltimport(1)
390 Applies a quilt patchset onto the current branch.
391
392 git-request-pull(1)
393 Generates a summary of pending changes.
394
395 git-send-email(1)
396 Send a collection of patches as emails.
397
398 git-svn(1)
399 Bidirectional operation between a Subversion repository and Git.
400
402 Although Git includes its own porcelain layer, its low-level commands
403 are sufficient to support development of alternative porcelains.
404 Developers of such porcelains might start by reading about git-update-
405 index(1) and git-read-tree(1).
406
407 The interface (input, output, set of options and the semantics) to
408 these low-level commands are meant to be a lot more stable than
409 Porcelain level commands, because these commands are primarily for
410 scripted use. The interface to Porcelain commands on the other hand are
411 subject to change in order to improve the end user experience.
412
413 The following description divides the low-level commands into commands
414 that manipulate objects (in the repository, index, and working tree),
415 commands that interrogate and compare objects, and commands that move
416 objects and references between repositories.
417
418 Manipulation commands
419 git-apply(1)
420 Apply a patch to files and/or to the index.
421
422 git-checkout-index(1)
423 Copy files from the index to the working tree.
424
425 git-commit-graph(1)
426 Write and verify Git commit-graph files.
427
428 git-commit-tree(1)
429 Create a new commit object.
430
431 git-hash-object(1)
432 Compute object ID and optionally creates a blob from a file.
433
434 git-index-pack(1)
435 Build pack index file for an existing packed archive.
436
437 git-merge-file(1)
438 Run a three-way file merge.
439
440 git-merge-index(1)
441 Run a merge for files needing merging.
442
443 git-mktag(1)
444 Creates a tag object.
445
446 git-mktree(1)
447 Build a tree-object from ls-tree formatted text.
448
449 git-multi-pack-index(1)
450 Write and verify multi-pack-indexes.
451
452 git-pack-objects(1)
453 Create a packed archive of objects.
454
455 git-prune-packed(1)
456 Remove extra objects that are already in pack files.
457
458 git-read-tree(1)
459 Reads tree information into the index.
460
461 git-symbolic-ref(1)
462 Read, modify and delete symbolic refs.
463
464 git-unpack-objects(1)
465 Unpack objects from a packed archive.
466
467 git-update-index(1)
468 Register file contents in the working tree to the index.
469
470 git-update-ref(1)
471 Update the object name stored in a ref safely.
472
473 git-write-tree(1)
474 Create a tree object from the current index.
475
476 Interrogation commands
477 git-cat-file(1)
478 Provide content or type and size information for repository
479 objects.
480
481 git-cherry(1)
482 Find commits yet to be applied to upstream.
483
484 git-diff-files(1)
485 Compares files in the working tree and the index.
486
487 git-diff-index(1)
488 Compare a tree to the working tree or index.
489
490 git-diff-tree(1)
491 Compares the content and mode of blobs found via two tree objects.
492
493 git-for-each-ref(1)
494 Output information on each ref.
495
496 git-get-tar-commit-id(1)
497 Extract commit ID from an archive created using git-archive.
498
499 git-ls-files(1)
500 Show information about files in the index and the working tree.
501
502 git-ls-remote(1)
503 List references in a remote repository.
504
505 git-ls-tree(1)
506 List the contents of a tree object.
507
508 git-merge-base(1)
509 Find as good common ancestors as possible for a merge.
510
511 git-name-rev(1)
512 Find symbolic names for given revs.
513
514 git-pack-redundant(1)
515 Find redundant pack files.
516
517 git-rev-list(1)
518 Lists commit objects in reverse chronological order.
519
520 git-rev-parse(1)
521 Pick out and massage parameters.
522
523 git-show-index(1)
524 Show packed archive index.
525
526 git-show-ref(1)
527 List references in a local repository.
528
529 git-unpack-file(1)
530 Creates a temporary file with a blob’s contents.
531
532 git-var(1)
533 Show a Git logical variable.
534
535 git-verify-pack(1)
536 Validate packed Git archive files.
537
538 In general, the interrogate commands do not touch the files in the
539 working tree.
540
541 Synching repositories
542 git-daemon(1)
543 A really simple server for Git repositories.
544
545 git-fetch-pack(1)
546 Receive missing objects from another repository.
547
548 git-http-backend(1)
549 Server side implementation of Git over HTTP.
550
551 git-send-pack(1)
552 Push objects over Git protocol to another repository.
553
554 git-update-server-info(1)
555 Update auxiliary info file to help dumb servers.
556
557 The following are helper commands used by the above; end users
558 typically do not use them directly.
559
560 git-http-fetch(1)
561 Download from a remote Git repository via HTTP.
562
563 git-http-push(1)
564 Push objects over HTTP/DAV to another repository.
565
566 git-parse-remote(1)
567 Routines to help parsing remote repository access parameters.
568
569 git-receive-pack(1)
570 Receive what is pushed into the repository.
571
572 git-shell(1)
573 Restricted login shell for Git-only SSH access.
574
575 git-upload-archive(1)
576 Send archive back to git-archive.
577
578 git-upload-pack(1)
579 Send objects packed back to git-fetch-pack.
580
581 Internal helper commands
582 These are internal helper commands used by other commands; end users
583 typically do not use them directly.
584
585 git-check-attr(1)
586 Display gitattributes information.
587
588 git-check-ignore(1)
589 Debug gitignore / exclude files.
590
591 git-check-mailmap(1)
592 Show canonical names and email addresses of contacts.
593
594 git-check-ref-format(1)
595 Ensures that a reference name is well formed.
596
597 git-column(1)
598 Display data in columns.
599
600 git-credential(1)
601 Retrieve and store user credentials.
602
603 git-credential-cache(1)
604 Helper to temporarily store passwords in memory.
605
606 git-credential-store(1)
607 Helper to store credentials on disk.
608
609 git-fmt-merge-msg(1)
610 Produce a merge commit message.
611
612 git-interpret-trailers(1)
613 add or parse structured information in commit messages.
614
615 git-mailinfo(1)
616 Extracts patch and authorship from a single e-mail message.
617
618 git-mailsplit(1)
619 Simple UNIX mbox splitter program.
620
621 git-merge-one-file(1)
622 The standard helper program to use with git-merge-index.
623
624 git-patch-id(1)
625 Compute unique ID for a patch.
626
627 git-sh-i18n(1)
628 Git’s i18n setup code for shell scripts.
629
630 git-sh-setup(1)
631 Common Git shell script setup code.
632
633 git-stripspace(1)
634 Remove unnecessary whitespace.
635
637 Git uses a simple text format to store customizations that are per
638 repository and are per user. Such a configuration file may look like
639 this:
640
641 #
642 # A '#' or ';' character indicates a comment.
643 #
644
645 ; core variables
646 [core]
647 ; Don't trust file modes
648 filemode = false
649
650 ; user identity
651 [user]
652 name = "Junio C Hamano"
653 email = "gitster@pobox.com"
654
655
656 Various commands read from the configuration file and adjust their
657 operation accordingly. See git-config(1) for a list and more details
658 about the configuration mechanism.
659
661 <object>
662 Indicates the object name for any type of object.
663
664 <blob>
665 Indicates a blob object name.
666
667 <tree>
668 Indicates a tree object name.
669
670 <commit>
671 Indicates a commit object name.
672
673 <tree-ish>
674 Indicates a tree, commit or tag object name. A command that takes a
675 <tree-ish> argument ultimately wants to operate on a <tree> object
676 but automatically dereferences <commit> and <tag> objects that
677 point at a <tree>.
678
679 <commit-ish>
680 Indicates a commit or tag object name. A command that takes a
681 <commit-ish> argument ultimately wants to operate on a <commit>
682 object but automatically dereferences <tag> objects that point at a
683 <commit>.
684
685 <type>
686 Indicates that an object type is required. Currently one of: blob,
687 tree, commit, or tag.
688
689 <file>
690 Indicates a filename - almost always relative to the root of the
691 tree structure GIT_INDEX_FILE describes.
692
694 Any Git command accepting any <object> can also use the following
695 symbolic notation:
696
697 HEAD
698 indicates the head of the current branch.
699
700 <tag>
701 a valid tag name (i.e. a refs/tags/<tag> reference).
702
703 <head>
704 a valid head name (i.e. a refs/heads/<head> reference).
705
706 For a more complete list of ways to spell object names, see "SPECIFYING
707 REVISIONS" section in gitrevisions(7).
708
710 Please see the gitrepository-layout(5) document.
711
712 Read githooks(5) for more details about each hook.
713
714 Higher level SCMs may provide and manage additional information in the
715 $GIT_DIR.
716
718 Please see gitglossary(7).
719
721 Various Git commands use the following environment variables:
722
723 The Git Repository
724 These environment variables apply to all core Git commands. Nb: it is
725 worth noting that they may be used/overridden by SCMS sitting above Git
726 so take care if using a foreign front-end.
727
728 GIT_INDEX_FILE
729 This environment allows the specification of an alternate index
730 file. If not specified, the default of $GIT_DIR/index is used.
731
732 GIT_INDEX_VERSION
733 This environment variable allows the specification of an index
734 version for new repositories. It won’t affect existing index files.
735 By default index file version 2 or 3 is used. See git-update-
736 index(1) for more information.
737
738 GIT_OBJECT_DIRECTORY
739 If the object storage directory is specified via this environment
740 variable then the sha1 directories are created underneath -
741 otherwise the default $GIT_DIR/objects directory is used.
742
743 GIT_ALTERNATE_OBJECT_DIRECTORIES
744 Due to the immutable nature of Git objects, old objects can be
745 archived into shared, read-only directories. This variable
746 specifies a ":" separated (on Windows ";" separated) list of Git
747 object directories which can be used to search for Git objects. New
748 objects will not be written to these directories.
749
750 Entries that begin with " (double-quote) will be interpreted as
751 C-style quoted paths, removing leading and trailing double-quotes
752 and respecting backslash escapes. E.g., the value
753 "path-with-\"-and-:-in-it":vanilla-path has two paths:
754 path-with-"-and-:-in-it and vanilla-path.
755
756 GIT_DIR
757 If the GIT_DIR environment variable is set then it specifies a path
758 to use instead of the default .git for the base of the repository.
759 The --git-dir command-line option also sets this value.
760
761 GIT_WORK_TREE
762 Set the path to the root of the working tree. This can also be
763 controlled by the --work-tree command-line option and the
764 core.worktree configuration variable.
765
766 GIT_NAMESPACE
767 Set the Git namespace; see gitnamespaces(7) for details. The
768 --namespace command-line option also sets this value.
769
770 GIT_CEILING_DIRECTORIES
771 This should be a colon-separated list of absolute paths. If set, it
772 is a list of directories that Git should not chdir up into while
773 looking for a repository directory (useful for excluding
774 slow-loading network directories). It will not exclude the current
775 working directory or a GIT_DIR set on the command line or in the
776 environment. Normally, Git has to read the entries in this list and
777 resolve any symlink that might be present in order to compare them
778 with the current directory. However, if even this access is slow,
779 you can add an empty entry to the list to tell Git that the
780 subsequent entries are not symlinks and needn’t be resolved; e.g.,
781 GIT_CEILING_DIRECTORIES=/maybe/symlink::/very/slow/non/symlink.
782
783 GIT_DISCOVERY_ACROSS_FILESYSTEM
784 When run in a directory that does not have ".git" repository
785 directory, Git tries to find such a directory in the parent
786 directories to find the top of the working tree, but by default it
787 does not cross filesystem boundaries. This environment variable can
788 be set to true to tell Git not to stop at filesystem boundaries.
789 Like GIT_CEILING_DIRECTORIES, this will not affect an explicit
790 repository directory set via GIT_DIR or on the command line.
791
792 GIT_COMMON_DIR
793 If this variable is set to a path, non-worktree files that are
794 normally in $GIT_DIR will be taken from this path instead.
795 Worktree-specific files such as HEAD or index are taken from
796 $GIT_DIR. See gitrepository-layout(5) and git-worktree(1) for
797 details. This variable has lower precedence than other path
798 variables such as GIT_INDEX_FILE, GIT_OBJECT_DIRECTORY...
799
800 Git Commits
801 GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME,
802 GIT_COMMITTER_EMAIL, GIT_COMMITTER_DATE, EMAIL
803 see git-commit-tree(1)
804
805 Git Diffs
806 GIT_DIFF_OPTS
807 Only valid setting is "--unified=??" or "-u??" to set the number of
808 context lines shown when a unified diff is created. This takes
809 precedence over any "-U" or "--unified" option value passed on the
810 Git diff command line.
811
812 GIT_EXTERNAL_DIFF
813 When the environment variable GIT_EXTERNAL_DIFF is set, the program
814 named by it is called, instead of the diff invocation described
815 above. For a path that is added, removed, or modified,
816 GIT_EXTERNAL_DIFF is called with 7 parameters:
817
818 path old-file old-hex old-mode new-file new-hex new-mode
819
820 where:
821
822 <old|new>-file
823 are files GIT_EXTERNAL_DIFF can use to read the contents of
824 <old|new>,
825
826 <old|new>-hex
827 are the 40-hexdigit SHA-1 hashes,
828
829 <old|new>-mode
830 are the octal representation of the file modes.
831
832 The file parameters can point at the user’s working file (e.g.
833 new-file in "git-diff-files"), /dev/null (e.g. old-file when a new
834 file is added), or a temporary file (e.g. old-file in the index).
835 GIT_EXTERNAL_DIFF should not worry about unlinking the temporary
836 file --- it is removed when GIT_EXTERNAL_DIFF exits.
837
838 For a path that is unmerged, GIT_EXTERNAL_DIFF is called with 1
839 parameter, <path>.
840
841 For each path GIT_EXTERNAL_DIFF is called, two environment
842 variables, GIT_DIFF_PATH_COUNTER and GIT_DIFF_PATH_TOTAL are set.
843
844 GIT_DIFF_PATH_COUNTER
845 A 1-based counter incremented by one for every path.
846
847 GIT_DIFF_PATH_TOTAL
848 The total number of paths.
849
850 other
851 GIT_MERGE_VERBOSITY
852 A number controlling the amount of output shown by the recursive
853 merge strategy. Overrides merge.verbosity. See git-merge(1)
854
855 GIT_PAGER
856 This environment variable overrides $PAGER. If it is set to an
857 empty string or to the value "cat", Git will not launch a pager.
858 See also the core.pager option in git-config(1).
859
860 GIT_EDITOR
861 This environment variable overrides $EDITOR and $VISUAL. It is used
862 by several Git commands when, on interactive mode, an editor is to
863 be launched. See also git-var(1) and the core.editor option in git-
864 config(1).
865
866 GIT_SSH, GIT_SSH_COMMAND
867 If either of these environment variables is set then git fetch and
868 git push will use the specified command instead of ssh when they
869 need to connect to a remote system. The command-line parameters
870 passed to the configured command are determined by the ssh variant.
871 See ssh.variant option in git-config(1) for details.
872
873 + $GIT_SSH_COMMAND takes precedence over $GIT_SSH, and is interpreted
874 by the shell, which allows additional arguments to be included.
875 $GIT_SSH on the other hand must be just the path to a program (which
876 can be a wrapper shell script, if additional arguments are needed).
877
878 + Usually it is easier to configure any desired options through your
879 personal .ssh/config file. Please consult your ssh documentation for
880 further details.
881
882 GIT_SSH_VARIANT
883 If this environment variable is set, it overrides Git’s
884 autodetection whether GIT_SSH/GIT_SSH_COMMAND/core.sshCommand refer
885 to OpenSSH, plink or tortoiseplink. This variable overrides the
886 config setting ssh.variant that serves the same purpose.
887
888 GIT_ASKPASS
889 If this environment variable is set, then Git commands which need
890 to acquire passwords or passphrases (e.g. for HTTP or IMAP
891 authentication) will call this program with a suitable prompt as
892 command-line argument and read the password from its STDOUT. See
893 also the core.askPass option in git-config(1).
894
895 GIT_TERMINAL_PROMPT
896 If this environment variable is set to 0, git will not prompt on
897 the terminal (e.g., when asking for HTTP authentication).
898
899 GIT_CONFIG_NOSYSTEM
900 Whether to skip reading settings from the system-wide
901 $(prefix)/etc/gitconfig file. This environment variable can be used
902 along with $HOME and $XDG_CONFIG_HOME to create a predictable
903 environment for a picky script, or you can set it temporarily to
904 avoid using a buggy /etc/gitconfig file while waiting for someone
905 with sufficient permissions to fix it.
906
907 GIT_FLUSH
908 If this environment variable is set to "1", then commands such as
909 git blame (in incremental mode), git rev-list, git log, git
910 check-attr and git check-ignore will force a flush of the output
911 stream after each record have been flushed. If this variable is set
912 to "0", the output of these commands will be done using completely
913 buffered I/O. If this environment variable is not set, Git will
914 choose buffered or record-oriented flushing based on whether stdout
915 appears to be redirected to a file or not.
916
917 GIT_TRACE
918 Enables general trace messages, e.g. alias expansion, built-in
919 command execution and external command execution.
920
921 If this variable is set to "1", "2" or "true" (comparison is case
922 insensitive), trace messages will be printed to stderr.
923
924 If the variable is set to an integer value greater than 2 and lower
925 than 10 (strictly) then Git will interpret this value as an open
926 file descriptor and will try to write the trace messages into this
927 file descriptor.
928
929 Alternatively, if the variable is set to an absolute path (starting
930 with a / character), Git will interpret this as a file path and
931 will try to append the trace messages to it.
932
933 Unsetting the variable, or setting it to empty, "0" or "false"
934 (case insensitive) disables trace messages.
935
936 GIT_TRACE_FSMONITOR
937 Enables trace messages for the filesystem monitor extension. See
938 GIT_TRACE for available trace output options.
939
940 GIT_TRACE_PACK_ACCESS
941 Enables trace messages for all accesses to any packs. For each
942 access, the pack file name and an offset in the pack is recorded.
943 This may be helpful for troubleshooting some pack-related
944 performance problems. See GIT_TRACE for available trace output
945 options.
946
947 GIT_TRACE_PACKET
948 Enables trace messages for all packets coming in or out of a given
949 program. This can help with debugging object negotiation or other
950 protocol issues. Tracing is turned off at a packet starting with
951 "PACK" (but see GIT_TRACE_PACKFILE below). See GIT_TRACE for
952 available trace output options.
953
954 GIT_TRACE_PACKFILE
955 Enables tracing of packfiles sent or received by a given program.
956 Unlike other trace output, this trace is verbatim: no headers, and
957 no quoting of binary data. You almost certainly want to direct into
958 a file (e.g., GIT_TRACE_PACKFILE=/tmp/my.pack) rather than
959 displaying it on the terminal or mixing it with other trace output.
960
961 Note that this is currently only implemented for the client side of
962 clones and fetches.
963
964 GIT_TRACE_PERFORMANCE
965 Enables performance related trace messages, e.g. total execution
966 time of each Git command. See GIT_TRACE for available trace output
967 options.
968
969 GIT_TRACE_SETUP
970 Enables trace messages printing the .git, working tree and current
971 working directory after Git has completed its setup phase. See
972 GIT_TRACE for available trace output options.
973
974 GIT_TRACE_SHALLOW
975 Enables trace messages that can help debugging fetching / cloning
976 of shallow repositories. See GIT_TRACE for available trace output
977 options.
978
979 GIT_TRACE_CURL
980 Enables a curl full trace dump of all incoming and outgoing data,
981 including descriptive information, of the git transport protocol.
982 This is similar to doing curl --trace-ascii on the command line.
983 This option overrides setting the GIT_CURL_VERBOSE environment
984 variable. See GIT_TRACE for available trace output options.
985
986 GIT_TRACE_CURL_NO_DATA
987 When a curl trace is enabled (see GIT_TRACE_CURL above), do not
988 dump data (that is, only dump info lines and headers).
989
990 GIT_REDACT_COOKIES
991 This can be set to a comma-separated list of strings. When a curl
992 trace is enabled (see GIT_TRACE_CURL above), whenever a "Cookies:"
993 header sent by the client is dumped, values of cookies whose key is
994 in that list (case-sensitive) are redacted.
995
996 GIT_LITERAL_PATHSPECS
997 Setting this variable to 1 will cause Git to treat all pathspecs
998 literally, rather than as glob patterns. For example, running
999 GIT_LITERAL_PATHSPECS=1 git log -- '*.c' will search for commits
1000 that touch the path *.c, not any paths that the glob *.c matches.
1001 You might want this if you are feeding literal paths to Git (e.g.,
1002 paths previously given to you by git ls-tree, --raw diff output,
1003 etc).
1004
1005 GIT_GLOB_PATHSPECS
1006 Setting this variable to 1 will cause Git to treat all pathspecs as
1007 glob patterns (aka "glob" magic).
1008
1009 GIT_NOGLOB_PATHSPECS
1010 Setting this variable to 1 will cause Git to treat all pathspecs as
1011 literal (aka "literal" magic).
1012
1013 GIT_ICASE_PATHSPECS
1014 Setting this variable to 1 will cause Git to treat all pathspecs as
1015 case-insensitive.
1016
1017 GIT_REFLOG_ACTION
1018 When a ref is updated, reflog entries are created to keep track of
1019 the reason why the ref was updated (which is typically the name of
1020 the high-level command that updated the ref), in addition to the
1021 old and new values of the ref. A scripted Porcelain command can use
1022 set_reflog_action helper function in git-sh-setup to set its name
1023 to this variable when it is invoked as the top level command by the
1024 end user, to be recorded in the body of the reflog.
1025
1026 GIT_REF_PARANOIA
1027 If set to 1, include broken or badly named refs when iterating over
1028 lists of refs. In a normal, non-corrupted repository, this does
1029 nothing. However, enabling it may help git to detect and abort some
1030 operations in the presence of broken refs. Git sets this variable
1031 automatically when performing destructive operations like git-
1032 prune(1). You should not need to set it yourself unless you want to
1033 be paranoid about making sure an operation has touched every ref
1034 (e.g., because you are cloning a repository to make a backup).
1035
1036 GIT_ALLOW_PROTOCOL
1037 If set to a colon-separated list of protocols, behave as if
1038 protocol.allow is set to never, and each of the listed protocols
1039 has protocol.<name>.allow set to always (overriding any existing
1040 configuration). In other words, any protocol not mentioned will be
1041 disallowed (i.e., this is a whitelist, not a blacklist). See the
1042 description of protocol.allow in git-config(1) for more details.
1043
1044 GIT_PROTOCOL_FROM_USER
1045 Set to 0 to prevent protocols used by fetch/push/clone which are
1046 configured to the user state. This is useful to restrict recursive
1047 submodule initialization from an untrusted repository or for
1048 programs which feed potentially-untrusted URLS to git commands. See
1049 git-config(1) for more details.
1050
1051 GIT_PROTOCOL
1052 For internal use only. Used in handshaking the wire protocol.
1053 Contains a colon : separated list of keys with optional values
1054 key[=value]. Presence of unknown keys and values must be ignored.
1055
1056 GIT_OPTIONAL_LOCKS
1057 If set to 0, Git will complete any requested operation without
1058 performing any optional sub-operations that require taking a lock.
1059 For example, this will prevent git status from refreshing the index
1060 as a side effect. This is useful for processes running in the
1061 background which do not want to cause lock contention with other
1062 operations on the repository. Defaults to 1.
1063
1064 GIT_REDIRECT_STDIN, GIT_REDIRECT_STDOUT, GIT_REDIRECT_STDERR
1065 Windows-only: allow redirecting the standard input/output/error
1066 handles to paths specified by the environment variables. This is
1067 particularly useful in multi-threaded applications where the
1068 canonical way to pass standard handles via CreateProcess() is not
1069 an option because it would require the handles to be marked
1070 inheritable (and consequently every spawned process would inherit
1071 them, possibly blocking regular Git operations). The primary
1072 intended use case is to use named pipes for communication (e.g.
1073 \\.\pipe\my-git-stdin-123).
1074
1075 Two special values are supported: off will simply close the
1076 corresponding standard handle, and if GIT_REDIRECT_STDERR is 2>&1,
1077 standard error will be redirected to the same handle as standard
1078 output.
1079
1080 GIT_PRINT_SHA1_ELLIPSIS (deprecated)
1081 If set to yes, print an ellipsis following an (abbreviated) SHA-1
1082 value. This affects indications of detached HEADs (git-checkout(1))
1083 and the raw diff output (git-diff(1)). Printing an ellipsis in the
1084 cases mentioned is no longer considered adequate and support for it
1085 is likely to be removed in the foreseeable future (along with the
1086 variable).
1087
1089 More detail on the following is available from the Git concepts chapter
1090 of the user-manual[2] and gitcore-tutorial(7).
1091
1092 A Git project normally consists of a working directory with a ".git"
1093 subdirectory at the top level. The .git directory contains, among other
1094 things, a compressed object database representing the complete history
1095 of the project, an "index" file which links that history to the current
1096 contents of the working tree, and named pointers into that history such
1097 as tags and branch heads.
1098
1099 The object database contains objects of three main types: blobs, which
1100 hold file data; trees, which point to blobs and other trees to build up
1101 directory hierarchies; and commits, which each reference a single tree
1102 and some number of parent commits.
1103
1104 The commit, equivalent to what other systems call a "changeset" or
1105 "version", represents a step in the project’s history, and each parent
1106 represents an immediately preceding step. Commits with more than one
1107 parent represent merges of independent lines of development.
1108
1109 All objects are named by the SHA-1 hash of their contents, normally
1110 written as a string of 40 hex digits. Such names are globally unique.
1111 The entire history leading up to a commit can be vouched for by signing
1112 just that commit. A fourth object type, the tag, is provided for this
1113 purpose.
1114
1115 When first created, objects are stored in individual files, but for
1116 efficiency may later be compressed together into "pack files".
1117
1118 Named pointers called refs mark interesting points in history. A ref
1119 may contain the SHA-1 name of an object or the name of another ref.
1120 Refs with names beginning ref/head/ contain the SHA-1 name of the most
1121 recent commit (or "head") of a branch under development. SHA-1 names of
1122 tags of interest are stored under ref/tags/. A special ref named HEAD
1123 contains the name of the currently checked-out branch.
1124
1125 The index file is initialized with a list of all paths and, for each
1126 path, a blob object and a set of attributes. The blob object represents
1127 the contents of the file as of the head of the current branch. The
1128 attributes (last modified time, size, etc.) are taken from the
1129 corresponding file in the working tree. Subsequent changes to the
1130 working tree can be found by comparing these attributes. The index may
1131 be updated with new content, and new commits may be created from the
1132 content stored in the index.
1133
1134 The index is also capable of storing multiple entries (called "stages")
1135 for a given pathname. These stages are used to hold the various
1136 unmerged version of a file when a merge is in progress.
1137
1139 See the references in the "description" section to get started using
1140 Git. The following is probably more detail than necessary for a
1141 first-time user.
1142
1143 The Git concepts chapter of the user-manual[2] and gitcore-tutorial(7)
1144 both provide introductions to the underlying Git architecture.
1145
1146 See gitworkflows(7) for an overview of recommended workflows.
1147
1148 See also the howto[3] documents for some useful examples.
1149
1150 The internals are documented in the Git API documentation[4].
1151
1152 Users migrating from CVS may also want to read gitcvs-migration(7).
1153
1155 Git was started by Linus Torvalds, and is currently maintained by Junio
1156 C Hamano. Numerous contributions have come from the Git mailing list
1157 <git@vger.kernel.org[5]>.
1158 http://www.openhub.net/p/git/contributors/summary gives you a more
1159 complete list of contributors.
1160
1161 If you have a clone of git.git itself, the output of git-shortlog(1)
1162 and git-blame(1) can show you the authors for specific parts of the
1163 project.
1164
1166 Report bugs to the Git mailing list <git@vger.kernel.org[5]> where the
1167 development and maintenance is primarily done. You do not have to be
1168 subscribed to the list to send a message there. See the list archive at
1169 https://public-inbox.org/git for previous bug reports and other
1170 discussions.
1171
1172 Issues which are security relevant should be disclosed privately to the
1173 Git Security mailing list <git-security@googlegroups.com[6]>.
1174
1176 gittutorial(7), gittutorial-2(7), giteveryday(7), gitcvs-migration(7),
1177 gitglossary(7), gitcore-tutorial(7), gitcli(7), The Git User’s
1178 Manual[1], gitworkflows(7)
1179
1181 Part of the git(1) suite
1182
1184 1. Git User’s Manual
1185 file:///usr/share/doc/git/user-manual.html
1186
1187 2. Git concepts chapter of the user-manual
1188 file:///usr/share/doc/git/user-manual.html#git-concepts
1189
1190 3. howto
1191 file:///usr/share/doc/git/howto-index.html
1192
1193 4. Git API documentation
1194 file:///usr/share/doc/git/technical/api-index.html
1195
1196 5. git@vger.kernel.org
1197 mailto:git@vger.kernel.org
1198
1199 6. git-security@googlegroups.com
1200 mailto:git-security@googlegroups.com
1201
1202
1203
1204Git 2.20.1 12/15/2018 GIT(1)