--version | Print the Git suite version number |
--help , --help --all | Prints synopsis. With --all or -a , all available commands are printed. git --help cmd is is the same as git help cmd |
-C /p/ath | Run as if git was started in /p/ath instead of the current working directory. Multiple relative paths can be combined using mutliple -C arguments. Compare with --git-dir |
-c option-name=value | Override configured option values for the command. |
--config-env=<name>=<envvar> | Like -c <name>=<value> : give configuration variable <name> a value, where <envvar> is the name of an environment variable from which to retrieve the value. |
--exec-path[=<path>] | Path to wherever your core Git programs are installed. This can also be controlled by setting the GIT_EXEC_PATH environment variable. If no path is given, git will print the current setting and then exit. |
--html-path | Print the path of Git’s HTML documentation is installed and exit. |
--man-path | Print the manpath for the man pages for this version of Git. |
--info-path | Print the path where the info files documenting this version of Git are installed. |
-p , --paginate | Pipe all output into less or $PAGER , if defined if std out is a terminal. This overrides the pager.<cmd> configuration options. |
-P , --no-pager | Do not pipe Git output into a pager. |
--git-dir=<path> | Set the absolute or relative path to the repository (.git directory). This can also be controlled by setting the GIT_DIR environment variable. Compare with -C . |
--work-tree=<path> | Set the absolute or repository path to the working tree. When using this option, pathspecs are treated as relative to the specified directory. |
--namespace=<path> | Set the Git namespace, equivalent to setting the GIT_NAMESPACE environment variable. |
--super-prefix=<path> | Sets a prefix which gives a path from above a repository down to its root. One use is to give submodules context about the superproject that invoked it. Currently for internal use only. |
--bare | Treat the repository as a bare repository. If GIT_DIR environment variable is not set, it is set to the current working directory. |
--no-replace-objects | Do not use replacement refs to replace Git objects. |
--literal-pathspecs | Treat pathspecs literally, that is without globbing or pathspec magic. This is equivalent to setting the GIT_LITERAL_PATHSPECS environment variable to 1. |
--glob-pathspecs | Add glob magic to all pathspec. This is equivalent to setting the GIT_GLOB_PATHSPECS environment variable to 1. Disabling globbing on individual pathspecs can be done using pathspec magic :(literal) . |
--noglob-pathspecs | Add literal magic to all pathspec. This is equivalent to setting the GIT_NOGLOB_PATHSPECS environment variable to 1. Enabling globbing on individual pathspecs can be done using pathspec magic :(glob) . |
--icase-pathspecs | Add icase magic to all pathspec. This is equivalent to setting the GIT_ICASE_PATHSPECS environment variable to 1. |
--no-optional-locks | Do not perform optional operations that require locks. This is equivalent to setting the GIT_OPTIONAL_LOCKS to 0. |
--list-cmds=group[,group…] | List commands by group.Supported groups are: builtins, parseopt (builtin commands that use parse-options), main (all commands in libexec directory), others (all other commands in $PATH that have git- prefix), list-<category> (see categories in command-list.txt), nohelpers (exclude helper commands), alias and config (retrieve command list from config variable completion.commands) This is an internal/experimental option and may change or be removed in the future. |
Note, the common options are located between
git
and the command name while the command's options follow the command name. Thus,
-c
can be specified in
git commit
twice: