1GIT(1)                            Git Manual                            GIT(1)
2
3
4

NAME

6       git - the stupid content tracker
7

SYNOPSIS

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

DESCRIPTION

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

OPTIONS

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 --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

GIT COMMANDS

164       We divide Git into high level ("porcelain") commands and low level
165       ("plumbing") commands.
166

HIGH-LEVEL COMMANDS (PORCELAIN)

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-rebase(1)
251           Reapply commits on top of another base tip.
252
253       git-reset(1)
254           Reset current HEAD to the specified state.
255
256       git-revert(1)
257           Revert some existing commits.
258
259       git-rm(1)
260           Remove files from the working tree and from the index.
261
262       git-shortlog(1)
263           Summarize git log output.
264
265       git-show(1)
266           Show various types of objects.
267
268       git-stash(1)
269           Stash the changes in a dirty working directory away.
270
271       git-status(1)
272           Show the working tree status.
273
274       git-submodule(1)
275           Initialize, update or inspect submodules.
276
277       git-tag(1)
278           Create, list, delete or verify a tag object signed with GPG.
279
280       git-worktree(1)
281           Manage multiple working trees.
282
283       gitk(1)
284           The Git repository browser.
285
286   Ancillary Commands
287       Manipulators:
288
289       git-config(1)
290           Get and set repository or global options.
291
292       git-fast-export(1)
293           Git data exporter.
294
295       git-fast-import(1)
296           Backend for fast Git data importers.
297
298       git-filter-branch(1)
299           Rewrite branches.
300
301       git-mergetool(1)
302           Run merge conflict resolution tools to resolve merge conflicts.
303
304       git-pack-refs(1)
305           Pack heads and tags for efficient repository access.
306
307       git-prune(1)
308           Prune all unreachable objects from the object database.
309
310       git-reflog(1)
311           Manage reflog information.
312
313       git-remote(1)
314           Manage set of tracked repositories.
315
316       git-repack(1)
317           Pack unpacked objects in a repository.
318
319       git-replace(1)
320           Create, list, delete refs to replace objects.
321
322       Interrogators:
323
324       git-annotate(1)
325           Annotate file lines with commit information.
326
327       git-blame(1)
328           Show what revision and author last modified each line of a file.
329
330       git-cherry(1)
331           Find commits yet to be applied to upstream.
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-get-tar-commit-id(1)
344           Extract commit ID from an archive created using git-archive.
345
346       git-help(1)
347           Display help information about Git.
348
349       git-instaweb(1)
350           Instantly browse your working repository in gitweb.
351
352       git-merge-tree(1)
353           Show three-way merge without touching index.
354
355       git-rerere(1)
356           Reuse recorded resolution of conflicted merges.
357
358       git-rev-parse(1)
359           Pick out and massage parameters.
360
361       git-show-branch(1)
362           Show branches and their commits.
363
364       git-verify-commit(1)
365           Check the GPG signature of commits.
366
367       git-verify-tag(1)
368           Check the GPG signature of tags.
369
370       git-whatchanged(1)
371           Show logs with difference each commit introduces.
372
373       gitweb(1)
374           Git web interface (web frontend to Git repositories).
375
376   Interacting with Others
377       These commands are to interact with foreign SCM and with other people
378       via patch over e-mail.
379
380       git-imap-send(1)
381           Send a collection of patches from stdin to an IMAP folder.
382
383       git-quiltimport(1)
384           Applies a quilt patchset onto the current branch.
385
386       git-request-pull(1)
387           Generates a summary of pending changes.
388
389       git-send-email(1)
390           Send a collection of patches as emails.
391
392       git-svn(1)
393           Bidirectional operation between a Subversion repository and Git.
394

LOW-LEVEL COMMANDS (PLUMBING)

396       Although Git includes its own porcelain layer, its low-level commands
397       are sufficient to support development of alternative porcelains.
398       Developers of such porcelains might start by reading about git-update-
399       index(1) and git-read-tree(1).
400
401       The interface (input, output, set of options and the semantics) to
402       these low-level commands are meant to be a lot more stable than
403       Porcelain level commands, because these commands are primarily for
404       scripted use. The interface to Porcelain commands on the other hand are
405       subject to change in order to improve the end user experience.
406
407       The following description divides the low-level commands into commands
408       that manipulate objects (in the repository, index, and working tree),
409       commands that interrogate and compare objects, and commands that move
410       objects and references between repositories.
411
412   Manipulation commands
413       git-apply(1)
414           Apply a patch to files and/or to the index.
415
416       git-checkout-index(1)
417           Copy files from the index to the working tree.
418
419       git-commit-graph(1)
420           Write and verify Git commit graph files.
421
422       git-commit-tree(1)
423           Create a new commit object.
424
425       git-hash-object(1)
426           Compute object ID and optionally creates a blob from a file.
427
428       git-index-pack(1)
429           Build pack index file for an existing packed archive.
430
431       git-merge-file(1)
432           Run a three-way file merge.
433
434       git-merge-index(1)
435           Run a merge for files needing merging.
436
437       git-mktag(1)
438           Creates a tag object.
439
440       git-mktree(1)
441           Build a tree-object from ls-tree formatted text.
442
443       git-pack-objects(1)
444           Create a packed archive of objects.
445
446       git-prune-packed(1)
447           Remove extra objects that are already in pack files.
448
449       git-read-tree(1)
450           Reads tree information into the index.
451
452       git-symbolic-ref(1)
453           Read, modify and delete symbolic refs.
454
455       git-unpack-objects(1)
456           Unpack objects from a packed archive.
457
458       git-update-index(1)
459           Register file contents in the working tree to the index.
460
461       git-update-ref(1)
462           Update the object name stored in a ref safely.
463
464       git-write-tree(1)
465           Create a tree object from the current index.
466
467   Interrogation commands
468       git-cat-file(1)
469           Provide content or type and size information for repository
470           objects.
471
472       git-diff-files(1)
473           Compares files in the working tree and the index.
474
475       git-diff-index(1)
476           Compare a tree to the working tree or index.
477
478       git-diff-tree(1)
479           Compares the content and mode of blobs found via two tree objects.
480
481       git-for-each-ref(1)
482           Output information on each ref.
483
484       git-ls-files(1)
485           Show information about files in the index and the working tree.
486
487       git-ls-remote(1)
488           List references in a remote repository.
489
490       git-ls-tree(1)
491           List the contents of a tree object.
492
493       git-merge-base(1)
494           Find as good common ancestors as possible for a merge.
495
496       git-name-rev(1)
497           Find symbolic names for given revs.
498
499       git-pack-redundant(1)
500           Find redundant pack files.
501
502       git-rev-list(1)
503           Lists commit objects in reverse chronological order.
504
505       git-show-index(1)
506           Show packed archive index.
507
508       git-show-ref(1)
509           List references in a local repository.
510
511       git-unpack-file(1)
512           Creates a temporary file with a blob’s contents.
513
514       git-var(1)
515           Show a Git logical variable.
516
517       git-verify-pack(1)
518           Validate packed Git archive files.
519
520       In general, the interrogate commands do not touch the files in the
521       working tree.
522
523   Synching repositories
524       git-daemon(1)
525           A really simple server for Git repositories.
526
527       git-fetch-pack(1)
528           Receive missing objects from another repository.
529
530       git-http-backend(1)
531           Server side implementation of Git over HTTP.
532
533       git-send-pack(1)
534           Push objects over Git protocol to another repository.
535
536       git-update-server-info(1)
537           Update auxiliary info file to help dumb servers.
538
539       The following are helper commands used by the above; end users
540       typically do not use them directly.
541
542       git-http-fetch(1)
543           Download from a remote Git repository via HTTP.
544
545       git-http-push(1)
546           Push objects over HTTP/DAV to another repository.
547
548       git-parse-remote(1)
549           Routines to help parsing remote repository access parameters.
550
551       git-receive-pack(1)
552           Receive what is pushed into the repository.
553
554       git-shell(1)
555           Restricted login shell for Git-only SSH access.
556
557       git-upload-archive(1)
558           Send archive back to git-archive.
559
560       git-upload-pack(1)
561           Send objects packed back to git-fetch-pack.
562
563   Internal helper commands
564       These are internal helper commands used by other commands; end users
565       typically do not use them directly.
566
567       git-check-attr(1)
568           Display gitattributes information.
569
570       git-check-ignore(1)
571           Debug gitignore / exclude files.
572
573       git-check-mailmap(1)
574           Show canonical names and email addresses of contacts.
575
576       git-check-ref-format(1)
577           Ensures that a reference name is well formed.
578
579       git-column(1)
580           Display data in columns.
581
582       git-credential(1)
583           Retrieve and store user credentials.
584
585       git-credential-cache(1)
586           Helper to temporarily store passwords in memory.
587
588       git-credential-store(1)
589           Helper to store credentials on disk.
590
591       git-fmt-merge-msg(1)
592           Produce a merge commit message.
593
594       git-interpret-trailers(1)
595           add or parse structured information in commit messages.
596
597       git-mailinfo(1)
598           Extracts patch and authorship from a single e-mail message.
599
600       git-mailsplit(1)
601           Simple UNIX mbox splitter program.
602
603       git-merge-one-file(1)
604           The standard helper program to use with git-merge-index.
605
606       git-patch-id(1)
607           Compute unique ID for a patch.
608
609       git-sh-i18n(1)
610           Git’s i18n setup code for shell scripts.
611
612       git-sh-setup(1)
613           Common Git shell script setup code.
614
615       git-stripspace(1)
616           Remove unnecessary whitespace.
617

CONFIGURATION MECHANISM

619       Git uses a simple text format to store customizations that are per
620       repository and are per user. Such a configuration file may look like
621       this:
622
623           #
624           # A '#' or ';' character indicates a comment.
625           #
626
627           ; core variables
628           [core]
629                   ; Don't trust file modes
630                   filemode = false
631
632           ; user identity
633           [user]
634                   name = "Junio C Hamano"
635                   email = "gitster@pobox.com"
636
637
638       Various commands read from the configuration file and adjust their
639       operation accordingly. See git-config(1) for a list and more details
640       about the configuration mechanism.
641

IDENTIFIER TERMINOLOGY

643       <object>
644           Indicates the object name for any type of object.
645
646       <blob>
647           Indicates a blob object name.
648
649       <tree>
650           Indicates a tree object name.
651
652       <commit>
653           Indicates a commit object name.
654
655       <tree-ish>
656           Indicates a tree, commit or tag object name. A command that takes a
657           <tree-ish> argument ultimately wants to operate on a <tree> object
658           but automatically dereferences <commit> and <tag> objects that
659           point at a <tree>.
660
661       <commit-ish>
662           Indicates a commit or tag object name. A command that takes a
663           <commit-ish> argument ultimately wants to operate on a <commit>
664           object but automatically dereferences <tag> objects that point at a
665           <commit>.
666
667       <type>
668           Indicates that an object type is required. Currently one of: blob,
669           tree, commit, or tag.
670
671       <file>
672           Indicates a filename - almost always relative to the root of the
673           tree structure GIT_INDEX_FILE describes.
674

SYMBOLIC IDENTIFIERS

676       Any Git command accepting any <object> can also use the following
677       symbolic notation:
678
679       HEAD
680           indicates the head of the current branch.
681
682       <tag>
683           a valid tag name (i.e. a refs/tags/<tag> reference).
684
685       <head>
686           a valid head name (i.e. a refs/heads/<head> reference).
687
688       For a more complete list of ways to spell object names, see "SPECIFYING
689       REVISIONS" section in gitrevisions(7).
690

FILE/DIRECTORY STRUCTURE

692       Please see the gitrepository-layout(5) document.
693
694       Read githooks(5) for more details about each hook.
695
696       Higher level SCMs may provide and manage additional information in the
697       $GIT_DIR.
698

TERMINOLOGY

700       Please see gitglossary(7).
701

ENVIRONMENT VARIABLES

703       Various Git commands use the following environment variables:
704
705   The Git Repository
706       These environment variables apply to all core Git commands. Nb: it is
707       worth noting that they may be used/overridden by SCMS sitting above Git
708       so take care if using a foreign front-end.
709
710       GIT_INDEX_FILE
711           This environment allows the specification of an alternate index
712           file. If not specified, the default of $GIT_DIR/index is used.
713
714       GIT_INDEX_VERSION
715           This environment variable allows the specification of an index
716           version for new repositories. It won’t affect existing index files.
717           By default index file version 2 or 3 is used. See git-update-
718           index(1) for more information.
719
720       GIT_OBJECT_DIRECTORY
721           If the object storage directory is specified via this environment
722           variable then the sha1 directories are created underneath -
723           otherwise the default $GIT_DIR/objects directory is used.
724
725       GIT_ALTERNATE_OBJECT_DIRECTORIES
726           Due to the immutable nature of Git objects, old objects can be
727           archived into shared, read-only directories. This variable
728           specifies a ":" separated (on Windows ";" separated) list of Git
729           object directories which can be used to search for Git objects. New
730           objects will not be written to these directories.
731
732               Entries that begin with `"` (double-quote) will be interpreted
733               as C-style quoted paths, removing leading and trailing
734               double-quotes and respecting backslash escapes. E.g., the value
735               `"path-with-\"-and-:-in-it":vanilla-path` has two paths:
736               `path-with-"-and-:-in-it` and `vanilla-path`.
737
738       GIT_DIR
739           If the GIT_DIR environment variable is set then it specifies a path
740           to use instead of the default .git for the base of the repository.
741           The --git-dir command-line option also sets this value.
742
743       GIT_WORK_TREE
744           Set the path to the root of the working tree. This can also be
745           controlled by the --work-tree command-line option and the
746           core.worktree configuration variable.
747
748       GIT_NAMESPACE
749           Set the Git namespace; see gitnamespaces(7) for details. The
750           --namespace command-line option also sets this value.
751
752       GIT_CEILING_DIRECTORIES
753           This should be a colon-separated list of absolute paths. If set, it
754           is a list of directories that Git should not chdir up into while
755           looking for a repository directory (useful for excluding
756           slow-loading network directories). It will not exclude the current
757           working directory or a GIT_DIR set on the command line or in the
758           environment. Normally, Git has to read the entries in this list and
759           resolve any symlink that might be present in order to compare them
760           with the current directory. However, if even this access is slow,
761           you can add an empty entry to the list to tell Git that the
762           subsequent entries are not symlinks and needn’t be resolved; e.g.,
763           GIT_CEILING_DIRECTORIES=/maybe/symlink::/very/slow/non/symlink.
764
765       GIT_DISCOVERY_ACROSS_FILESYSTEM
766           When run in a directory that does not have ".git" repository
767           directory, Git tries to find such a directory in the parent
768           directories to find the top of the working tree, but by default it
769           does not cross filesystem boundaries. This environment variable can
770           be set to true to tell Git not to stop at filesystem boundaries.
771           Like GIT_CEILING_DIRECTORIES, this will not affect an explicit
772           repository directory set via GIT_DIR or on the command line.
773
774       GIT_COMMON_DIR
775           If this variable is set to a path, non-worktree files that are
776           normally in $GIT_DIR will be taken from this path instead.
777           Worktree-specific files such as HEAD or index are taken from
778           $GIT_DIR. See gitrepository-layout(5) and git-worktree(1) for
779           details. This variable has lower precedence than other path
780           variables such as GIT_INDEX_FILE, GIT_OBJECT_DIRECTORY...
781
782   Git Commits
783       GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME,
784       GIT_COMMITTER_EMAIL, GIT_COMMITTER_DATE, EMAIL
785           see git-commit-tree(1)
786
787   Git Diffs
788       GIT_DIFF_OPTS
789           Only valid setting is "--unified=??" or "-u??" to set the number of
790           context lines shown when a unified diff is created. This takes
791           precedence over any "-U" or "--unified" option value passed on the
792           Git diff command line.
793
794       GIT_EXTERNAL_DIFF
795           When the environment variable GIT_EXTERNAL_DIFF is set, the program
796           named by it is called, instead of the diff invocation described
797           above. For a path that is added, removed, or modified,
798           GIT_EXTERNAL_DIFF is called with 7 parameters:
799
800               path old-file old-hex old-mode new-file new-hex new-mode
801
802           where:
803
804       <old|new>-file
805           are files GIT_EXTERNAL_DIFF can use to read the contents of
806           <old|new>,
807
808       <old|new>-hex
809           are the 40-hexdigit SHA-1 hashes,
810
811       <old|new>-mode
812           are the octal representation of the file modes.
813
814           The file parameters can point at the user’s working file (e.g.
815           new-file in "git-diff-files"), /dev/null (e.g.  old-file when a new
816           file is added), or a temporary file (e.g.  old-file in the index).
817           GIT_EXTERNAL_DIFF should not worry about unlinking the temporary
818           file --- it is removed when GIT_EXTERNAL_DIFF exits.
819
820           For a path that is unmerged, GIT_EXTERNAL_DIFF is called with 1
821           parameter, <path>.
822
823           For each path GIT_EXTERNAL_DIFF is called, two environment
824           variables, GIT_DIFF_PATH_COUNTER and GIT_DIFF_PATH_TOTAL are set.
825
826       GIT_DIFF_PATH_COUNTER
827           A 1-based counter incremented by one for every path.
828
829       GIT_DIFF_PATH_TOTAL
830           The total number of paths.
831
832   other
833       GIT_MERGE_VERBOSITY
834           A number controlling the amount of output shown by the recursive
835           merge strategy. Overrides merge.verbosity. See git-merge(1)
836
837       GIT_PAGER
838           This environment variable overrides $PAGER. If it is set to an
839           empty string or to the value "cat", Git will not launch a pager.
840           See also the core.pager option in git-config(1).
841
842       GIT_EDITOR
843           This environment variable overrides $EDITOR and $VISUAL. It is used
844           by several Git commands when, on interactive mode, an editor is to
845           be launched. See also git-var(1) and the core.editor option in git-
846           config(1).
847
848       GIT_SSH, GIT_SSH_COMMAND
849           If either of these environment variables is set then git fetch and
850           git push will use the specified command instead of ssh when they
851           need to connect to a remote system. The command-line parameters
852           passed to the configured command are determined by the ssh variant.
853           See ssh.variant option in git-config(1) for details.
854
855       + $GIT_SSH_COMMAND takes precedence over $GIT_SSH, and is interpreted
856       by the shell, which allows additional arguments to be included.
857       $GIT_SSH on the other hand must be just the path to a program (which
858       can be a wrapper shell script, if additional arguments are needed).
859
860       + Usually it is easier to configure any desired options through your
861       personal .ssh/config file. Please consult your ssh documentation for
862       further details.
863
864       GIT_SSH_VARIANT
865           If this environment variable is set, it overrides Git’s
866           autodetection whether GIT_SSH/GIT_SSH_COMMAND/core.sshCommand refer
867           to OpenSSH, plink or tortoiseplink. This variable overrides the
868           config setting ssh.variant that serves the same purpose.
869
870       GIT_ASKPASS
871           If this environment variable is set, then Git commands which need
872           to acquire passwords or passphrases (e.g. for HTTP or IMAP
873           authentication) will call this program with a suitable prompt as
874           command-line argument and read the password from its STDOUT. See
875           also the core.askPass option in git-config(1).
876
877       GIT_TERMINAL_PROMPT
878           If this environment variable is set to 0, git will not prompt on
879           the terminal (e.g., when asking for HTTP authentication).
880
881       GIT_CONFIG_NOSYSTEM
882           Whether to skip reading settings from the system-wide
883           $(prefix)/etc/gitconfig file. This environment variable can be used
884           along with $HOME and $XDG_CONFIG_HOME to create a predictable
885           environment for a picky script, or you can set it temporarily to
886           avoid using a buggy /etc/gitconfig file while waiting for someone
887           with sufficient permissions to fix it.
888
889       GIT_FLUSH
890           If this environment variable is set to "1", then commands such as
891           git blame (in incremental mode), git rev-list, git log, git
892           check-attr and git check-ignore will force a flush of the output
893           stream after each record have been flushed. If this variable is set
894           to "0", the output of these commands will be done using completely
895           buffered I/O. If this environment variable is not set, Git will
896           choose buffered or record-oriented flushing based on whether stdout
897           appears to be redirected to a file or not.
898
899       GIT_TRACE
900           Enables general trace messages, e.g. alias expansion, built-in
901           command execution and external command execution.
902
903           If this variable is set to "1", "2" or "true" (comparison is case
904           insensitive), trace messages will be printed to stderr.
905
906           If the variable is set to an integer value greater than 2 and lower
907           than 10 (strictly) then Git will interpret this value as an open
908           file descriptor and will try to write the trace messages into this
909           file descriptor.
910
911           Alternatively, if the variable is set to an absolute path (starting
912           with a / character), Git will interpret this as a file path and
913           will try to write the trace messages into it.
914
915           Unsetting the variable, or setting it to empty, "0" or "false"
916           (case insensitive) disables trace messages.
917
918       GIT_TRACE_FSMONITOR
919           Enables trace messages for the filesystem monitor extension. See
920           GIT_TRACE for available trace output options.
921
922       GIT_TRACE_PACK_ACCESS
923           Enables trace messages for all accesses to any packs. For each
924           access, the pack file name and an offset in the pack is recorded.
925           This may be helpful for troubleshooting some pack-related
926           performance problems. See GIT_TRACE for available trace output
927           options.
928
929       GIT_TRACE_PACKET
930           Enables trace messages for all packets coming in or out of a given
931           program. This can help with debugging object negotiation or other
932           protocol issues. Tracing is turned off at a packet starting with
933           "PACK" (but see GIT_TRACE_PACKFILE below). See GIT_TRACE for
934           available trace output options.
935
936       GIT_TRACE_PACKFILE
937           Enables tracing of packfiles sent or received by a given program.
938           Unlike other trace output, this trace is verbatim: no headers, and
939           no quoting of binary data. You almost certainly want to direct into
940           a file (e.g., GIT_TRACE_PACKFILE=/tmp/my.pack) rather than
941           displaying it on the terminal or mixing it with other trace output.
942
943           Note that this is currently only implemented for the client side of
944           clones and fetches.
945
946       GIT_TRACE_PERFORMANCE
947           Enables performance related trace messages, e.g. total execution
948           time of each Git command. See GIT_TRACE for available trace output
949           options.
950
951       GIT_TRACE_SETUP
952           Enables trace messages printing the .git, working tree and current
953           working directory after Git has completed its setup phase. See
954           GIT_TRACE for available trace output options.
955
956       GIT_TRACE_SHALLOW
957           Enables trace messages that can help debugging fetching / cloning
958           of shallow repositories. See GIT_TRACE for available trace output
959           options.
960
961       GIT_TRACE_CURL
962           Enables a curl full trace dump of all incoming and outgoing data,
963           including descriptive information, of the git transport protocol.
964           This is similar to doing curl --trace-ascii on the command line.
965           This option overrides setting the GIT_CURL_VERBOSE environment
966           variable. See GIT_TRACE for available trace output options.
967
968       GIT_TRACE_CURL_NO_DATA
969           When a curl trace is enabled (see GIT_TRACE_CURL above), do not
970           dump data (that is, only dump info lines and headers).
971
972       GIT_REDACT_COOKIES
973           This can be set to a comma-separated list of strings. When a curl
974           trace is enabled (see GIT_TRACE_CURL above), whenever a "Cookies:"
975           header sent by the client is dumped, values of cookies whose key is
976           in that list (case-sensitive) are redacted.
977
978       GIT_LITERAL_PATHSPECS
979           Setting this variable to 1 will cause Git to treat all pathspecs
980           literally, rather than as glob patterns. For example, running
981           GIT_LITERAL_PATHSPECS=1 git log -- '*.c' will search for commits
982           that touch the path *.c, not any paths that the glob *.c matches.
983           You might want this if you are feeding literal paths to Git (e.g.,
984           paths previously given to you by git ls-tree, --raw diff output,
985           etc).
986
987       GIT_GLOB_PATHSPECS
988           Setting this variable to 1 will cause Git to treat all pathspecs as
989           glob patterns (aka "glob" magic).
990
991       GIT_NOGLOB_PATHSPECS
992           Setting this variable to 1 will cause Git to treat all pathspecs as
993           literal (aka "literal" magic).
994
995       GIT_ICASE_PATHSPECS
996           Setting this variable to 1 will cause Git to treat all pathspecs as
997           case-insensitive.
998
999       GIT_REFLOG_ACTION
1000           When a ref is updated, reflog entries are created to keep track of
1001           the reason why the ref was updated (which is typically the name of
1002           the high-level command that updated the ref), in addition to the
1003           old and new values of the ref. A scripted Porcelain command can use
1004           set_reflog_action helper function in git-sh-setup to set its name
1005           to this variable when it is invoked as the top level command by the
1006           end user, to be recorded in the body of the reflog.
1007
1008       GIT_REF_PARANOIA
1009           If set to 1, include broken or badly named refs when iterating over
1010           lists of refs. In a normal, non-corrupted repository, this does
1011           nothing. However, enabling it may help git to detect and abort some
1012           operations in the presence of broken refs. Git sets this variable
1013           automatically when performing destructive operations like git-
1014           prune(1). You should not need to set it yourself unless you want to
1015           be paranoid about making sure an operation has touched every ref
1016           (e.g., because you are cloning a repository to make a backup).
1017
1018       GIT_ALLOW_PROTOCOL
1019           If set to a colon-separated list of protocols, behave as if
1020           protocol.allow is set to never, and each of the listed protocols
1021           has protocol.<name>.allow set to always (overriding any existing
1022           configuration). In other words, any protocol not mentioned will be
1023           disallowed (i.e., this is a whitelist, not a blacklist). See the
1024           description of protocol.allow in git-config(1) for more details.
1025
1026       GIT_PROTOCOL_FROM_USER
1027           Set to 0 to prevent protocols used by fetch/push/clone which are
1028           configured to the user state. This is useful to restrict recursive
1029           submodule initialization from an untrusted repository or for
1030           programs which feed potentially-untrusted URLS to git commands. See
1031           git-config(1) for more details.
1032
1033       GIT_PROTOCOL
1034           For internal use only. Used in handshaking the wire protocol.
1035           Contains a colon : separated list of keys with optional values
1036           key[=value]. Presence of unknown keys and values must be ignored.
1037
1038       GIT_OPTIONAL_LOCKS
1039           If set to 0, Git will complete any requested operation without
1040           performing any optional sub-operations that require taking a lock.
1041           For example, this will prevent git status from refreshing the index
1042           as a side effect. This is useful for processes running in the
1043           background which do not want to cause lock contention with other
1044           operations on the repository. Defaults to 1.
1045
1046       GIT_REDIRECT_STDIN, GIT_REDIRECT_STDOUT, GIT_REDIRECT_STDERR
1047           Windows-only: allow redirecting the standard input/output/error
1048           handles to paths specified by the environment variables. This is
1049           particularly useful in multi-threaded applications where the
1050           canonical way to pass standard handles via CreateProcess() is not
1051           an option because it would require the handles to be marked
1052           inheritable (and consequently every spawned process would inherit
1053           them, possibly blocking regular Git operations). The primary
1054           intended use case is to use named pipes for communication (e.g.
1055           \\.\pipe\my-git-stdin-123).
1056
1057           Two special values are supported: off will simply close the
1058           corresponding standard handle, and if GIT_REDIRECT_STDERR is 2>&1,
1059           standard error will be redirected to the same handle as standard
1060           output.
1061
1062       GIT_PRINT_SHA1_ELLIPSIS (deprecated)
1063           If set to yes, print an ellipsis following an (abbreviated) SHA-1
1064           value. This affects indications of detached HEADs (git-checkout(1))
1065           and the raw diff output (git-diff(1)). Printing an ellipsis in the
1066           cases mentioned is no longer considered adequate and support for it
1067           is likely to be removed in the foreseeable future (along with the
1068           variable).
1069

DISCUSSION

1071       More detail on the following is available from the Git concepts chapter
1072       of the user-manual[2] and gitcore-tutorial(7).
1073
1074       A Git project normally consists of a working directory with a ".git"
1075       subdirectory at the top level. The .git directory contains, among other
1076       things, a compressed object database representing the complete history
1077       of the project, an "index" file which links that history to the current
1078       contents of the working tree, and named pointers into that history such
1079       as tags and branch heads.
1080
1081       The object database contains objects of three main types: blobs, which
1082       hold file data; trees, which point to blobs and other trees to build up
1083       directory hierarchies; and commits, which each reference a single tree
1084       and some number of parent commits.
1085
1086       The commit, equivalent to what other systems call a "changeset" or
1087       "version", represents a step in the project’s history, and each parent
1088       represents an immediately preceding step. Commits with more than one
1089       parent represent merges of independent lines of development.
1090
1091       All objects are named by the SHA-1 hash of their contents, normally
1092       written as a string of 40 hex digits. Such names are globally unique.
1093       The entire history leading up to a commit can be vouched for by signing
1094       just that commit. A fourth object type, the tag, is provided for this
1095       purpose.
1096
1097       When first created, objects are stored in individual files, but for
1098       efficiency may later be compressed together into "pack files".
1099
1100       Named pointers called refs mark interesting points in history. A ref
1101       may contain the SHA-1 name of an object or the name of another ref.
1102       Refs with names beginning ref/head/ contain the SHA-1 name of the most
1103       recent commit (or "head") of a branch under development. SHA-1 names of
1104       tags of interest are stored under ref/tags/. A special ref named HEAD
1105       contains the name of the currently checked-out branch.
1106
1107       The index file is initialized with a list of all paths and, for each
1108       path, a blob object and a set of attributes. The blob object represents
1109       the contents of the file as of the head of the current branch. The
1110       attributes (last modified time, size, etc.) are taken from the
1111       corresponding file in the working tree. Subsequent changes to the
1112       working tree can be found by comparing these attributes. The index may
1113       be updated with new content, and new commits may be created from the
1114       content stored in the index.
1115
1116       The index is also capable of storing multiple entries (called "stages")
1117       for a given pathname. These stages are used to hold the various
1118       unmerged version of a file when a merge is in progress.
1119

FURTHER DOCUMENTATION

1121       See the references in the "description" section to get started using
1122       Git. The following is probably more detail than necessary for a
1123       first-time user.
1124
1125       The Git concepts chapter of the user-manual[2] and gitcore-tutorial(7)
1126       both provide introductions to the underlying Git architecture.
1127
1128       See gitworkflows(7) for an overview of recommended workflows.
1129
1130       See also the howto[3] documents for some useful examples.
1131
1132       The internals are documented in the Git API documentation[4].
1133
1134       Users migrating from CVS may also want to read gitcvs-migration(7).
1135

AUTHORS

1137       Git was started by Linus Torvalds, and is currently maintained by Junio
1138       C Hamano. Numerous contributions have come from the Git mailing list
1139       <git@vger.kernel.org[5]>.
1140       http://www.openhub.net/p/git/contributors/summary gives you a more
1141       complete list of contributors.
1142
1143       If you have a clone of git.git itself, the output of git-shortlog(1)
1144       and git-blame(1) can show you the authors for specific parts of the
1145       project.
1146

REPORTING BUGS

1148       Report bugs to the Git mailing list <git@vger.kernel.org[5]> where the
1149       development and maintenance is primarily done. You do not have to be
1150       subscribed to the list to send a message there.
1151
1152       Issues which are security relevant should be disclosed privately to the
1153       Git Security mailing list <git-security@googlegroups.com[6]>.
1154

SEE ALSO

1156       gittutorial(7), gittutorial-2(7), giteveryday(7), gitcvs-migration(7),
1157       gitglossary(7), gitcore-tutorial(7), gitcli(7), The Git User’s
1158       Manual[1], gitworkflows(7)
1159

GIT

1161       Part of the git(1) suite
1162

NOTES

1164        1. Git User’s Manual
1165           file:///usr/share/doc/git/user-manual.html
1166
1167        2. Git concepts chapter of the user-manual
1168           file:///usr/share/doc/git/user-manual.html#git-concepts
1169
1170        3. howto
1171           file:///usr/share/doc/git/howto-index.html
1172
1173        4. Git API documentation
1174           file:///usr/share/doc/git/technical/api-index.html
1175
1176        5. git@vger.kernel.org
1177           mailto:git@vger.kernel.org
1178
1179        6. git-security@googlegroups.com
1180           mailto:git-security@googlegroups.com
1181
1182
1183
1184Git 2.18.1                        05/14/2019                            GIT(1)
Impressum