Documentation
¶
Overview ¶
Package global contains the global git command options/
SYNOPSIS ¶
Reference: https://git-scm.com/docs/git
git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--no-lazy-fetch] [--no-optional-locks] [--no-advice] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] [--config-env=<name>=<envvar>] <command> [<args>]
Index ¶
- func AttrSource(treeIsh string) types.Option
- func Bare(g *types.Cmd)
- func ConfigEnv(name, envvar string) types.Option
- func ExecPath(path string) types.Option
- func GitDir(path string) types.Option
- func GlobPathSpecs(g *types.Cmd)
- func HTMLPath() types.Option
- func ICasePathSpecs(g *types.Cmd)
- func InfoPath() types.Option
- func LiteralPathSpecs(g *types.Cmd)
- func LowerC(name, value string) types.Option
- func ManPath() types.Option
- func Namespace(path string) types.Option
- func NoAdvice(g *types.Cmd)
- func NoGlobPathSpecs(g *types.Cmd)
- func NoLazyFetch(g *types.Cmd)
- func NoOptionalLocks(g *types.Cmd)
- func NoPager() types.Option
- func NoReplaceObjects(g *types.Cmd)
- func Paginate() types.Option
- func UpperC(path string) types.Option
- func WorkTree(path string) types.Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttrSource ¶
AttrSource Read gitattributes from <tree-ish> instead of the worktree. See gitattributes[5]. This is equivalent to setting the GIT_ATTR_SOURCE environment variable. --attr-source=<tree-ish>
func Bare ¶
Bare Treat the repository as a bare repository. If GIT_DIR environment is not set, it is set to the current working directory. --bare
func ConfigEnv ¶
ConfigEnv 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. Unlike -c there is no shortcut for directly setting the value to an empty string, instead the environment variable itself must be set to the empty string. It is an error if the <envvar> does not exist in the environment. <envvar> may not contain an equals sign to avoid ambiguity with <name> containing one. --config-env=<name>=<envvar>
func ExecPath ¶
ExecPath 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. --exec-path[=<path>]
func GitDir ¶
GitDir Set the path to the repository (".git" directory). This can also be controlled by setting the GIT_DIR environment variable. It can be an absolute path or relative path to current working directory.
Specifying the location of the ".git" directory using this option (or GIT_DIR environment variable) turns off the repository discovery that tries to find a directory with ".git" subdirectory (which is how the repository and the top-level of the working tree are discovered), and tells Git that you are at the top level of the working tree. If you are not at the top-level directory of the working tree, you should tell Git where the top-level of the working tree is, with the --work-tree=<path> option (or GIT_WORK_TREE environment variable).
If you just want to run git as if it was started in <path> then use git -C <path>. --git-dir=<path>
func GlobPathSpecs ¶
GlobPathSpecs 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)" --glob-pathspecs
func HTMLPath ¶
HTMLPath Print the path, without trailing slash, where Git’s HTML documentation is installed and exit. --html-path
func ICasePathSpecs ¶
ICasePathSpecs Add "icase" magic to all pathspec. This is equivalent to setting the GIT_ICASE_PATHSPECS environment variable to 1. --icase-pathspecs
func InfoPath ¶
InfoPath Print the path where the Info files documenting this version of Git are installed and exit. --info-path
func LiteralPathSpecs ¶
LiteralPathSpecs Treat pathspecs literally (i.e. no globbing, no pathspec magic). This is equivalent to setting the GIT_LITERAL_PATHSPECS environment variable to 1. --literal-pathspecs
func LowerC ¶
LowerC Pass a configuration parameter to the command. The value given will override values from configuration files. The <name> is expected in the same format as listed by git config (subkeys separated by dots). -c foo.bar=value
func ManPath ¶
ManPath Print the manpath (see man(1)) for the man pages for this version of Git and exit. --man-path
func Namespace ¶
Namespace Set the Git namespace. See gitnamespaces[7] for more details. Equivalent to setting the GIT_NAMESPACE environment variable. --namespace=<path>
func NoGlobPathSpecs ¶
NoGlobPathSpecs 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)" --noglob-pathspecs
func NoLazyFetch ¶
NoLazyFetch Do not fetch missing objects from the promisor remote on demand. Useful together with git cat-file -e <object> to see if the object is locally available. This is equivalent to setting the GIT_NO_LAZY_FETCH environment variable to 1. --no-lazy-fetch
func NoOptionalLocks ¶
NoOptionalLocks Do not perform optional operations that require locks. This is equivalent to setting the GIT_OPTIONAL_LOCKS to 0. --no-optional-locks
func NoReplaceObjects ¶
NoReplaceObjects Do not use replacement refs to replace Git objects. This is equivalent to exporting the GIT_NO_REPLACE_OBJECTS environment variable with any value. See git-replace[1] for more information. --no-replace-objects
func Paginate ¶
Paginate Pipe all output into less (or if set, $PAGER) if standard output is a terminal. This overrides the pager.<cmd> configuration options (see the "Configuration Mechanism" section below). -p --paginate
func UpperC ¶
UpperC Run as if git was started in <path> instead of the current working directory. When multiple -C options are given, each subsequent non-absolute -C <path> is interpreted relative to the preceding -C <path>. If <path> is present but empty, e.g. -C "", then the current working directory is left unchanged.
This option affects options that expect path name like --git-dir and --work-tree in that their interpretations of the path names would be made relative to the working directory caused by the -C option. -C path
func WorkTree ¶
WorkTree Set the path to the working tree. It can be an absolute path or a path relative to the current working directory. This can also be controlled by setting the GIT_WORK_TREE environment variable and the core.worktree configuration variable (see core.worktree in git-config[1] for a more detailed discussion). --work-tree=<path>
Types ¶
This section is empty.