{
    "content": [
        {
            "type": "text",
            "text": "# git-fetch (info)\n\n## NAME\n\ngit-fetch - Download objects and refs from another repository\n\n## SYNOPSIS\n\ngit fetch [<options>] [<repository> [<refspec>...]]\ngit fetch [<options>] <group>\ngit fetch --multiple [<options>] [(<repository> | <group>)...]\ngit fetch --all [<options>]\n\n## DESCRIPTION\n\nFetch branches and/or tags (collectively, \"refs\") from one or more\nother repositories, along with the objects necessary to complete their\nhistories. Remote-tracking branches are updated (see the description of\n<refspec> below for ways to control this behavior).\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (26 subsections)\n- **GIT URLS**\n- **REMOTES**\n- **CONFIGURED REMOTE-TRACKING BRANCHES**\n- **PRUNING**\n- **OUTPUT**\n- **EXAMPLES**\n- **SECURITY**\n- **BUGS**\n- **SEE ALSO**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "git-fetch",
        "section": "",
        "mode": "info",
        "summary": "git-fetch - Download objects and refs from another repository",
        "synopsis": "git fetch [<options>] [<repository> [<refspec>...]]\ngit fetch [<options>] <group>\ngit fetch --multiple [<options>] [(<repository> | <group>)...]\ngit fetch --all [<options>]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "",
                "long": "--all",
                "arg": null,
                "description": "Fetch all remotes."
            },
            {
                "flag": "-a",
                "long": "--append",
                "arg": null,
                "description": "Append ref names and object names of fetched refs to the existing contents of .git/FETCHHEAD. Without this option old data in .git/FETCHHEAD will be overwritten."
            },
            {
                "flag": "",
                "long": "--atomic",
                "arg": null,
                "description": "Use an atomic transaction to update local refs. Either all refs are updated, or on error, no refs are updated. --depth=<depth> Limit fetching to the specified number of commits from the tip of each remote branch history. If fetching to a shallow repository created by git clone with --depth=<depth> option (see git- clone(1)), deepen or shorten the history to the specified number of commits. Tags for the deepened commits are not fetched. --deepen=<depth> Similar to --depth, except it specifies the number of commits from the current shallow boundary instead of from the tip of each remote branch history. --shallow-since=<date> Deepen or shorten the history of a shallow repository to include all reachable commits after <date>. --shallow-exclude=<revision> Deepen or shorten the history of a shallow repository to exclude commits reachable from a specified remote branch or tag. This option can be specified multiple times."
            },
            {
                "flag": "",
                "long": "--unshallow",
                "arg": null,
                "description": "If the source repository is complete, convert a shallow repository to a complete one, removing all the limitations imposed by shallow repositories. If the source repository is shallow, fetch as much as possible so that the current repository has the same history as the source repository."
            },
            {
                "flag": "",
                "long": "--update-shallow",
                "arg": null,
                "description": "By default when fetching from a shallow repository, git fetch refuses refs that require updating .git/shallow. This option updates .git/shallow and accept such refs. --negotiation-tip=<commit|glob> By default, Git will report, to the server, commits reachable from all local refs to find common commits in an attempt to reduce the size of the to-be-received packfile. If specified, Git will only report commits reachable from the given tips. This is useful to speed up fetches when the user knows which local ref is likely to have commits in common with the upstream ref being fetched. This option may be specified more than once; if so, Git will report commits reachable from any of the given commits. The argument to this option may be a glob on ref names, a ref, or the (possibly abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying this option multiple times, one for each matching ref name. See also the fetch.negotiationAlgorithm and push.negotiate configuration variables documented in git-config(1), and the --negotiate-only option below."
            },
            {
                "flag": "",
                "long": "--negotiate-only",
                "arg": null,
                "description": "Do not fetch anything from the server, and instead print the ancestors of the provided --negotiation-tip=* arguments, which we have in common with the server. Internally this is used to implement the push.negotiate option, see git-config(1)."
            },
            {
                "flag": "",
                "long": "--dry-run",
                "arg": null,
                "description": "Show what would be done, without making any changes. --[no-]write-fetch-head Write the list of remote refs fetched in the FETCHHEAD file directly under $GITDIR. This is the default. Passing --no-write-fetch-head from the command line tells Git not to write the file. Under --dry-run option, the file is never written."
            },
            {
                "flag": "-f",
                "long": "--force",
                "arg": null,
                "description": "When git fetch is used with <src>:<dst> refspec it may refuse to update the local branch as discussed in the <refspec> part below. This option overrides that check."
            },
            {
                "flag": "-k",
                "long": "--keep",
                "arg": null,
                "description": "Keep downloaded pack."
            },
            {
                "flag": "",
                "long": "--multiple",
                "arg": null,
                "description": "Allow several <repository> and <group> arguments to be specified. No <refspec>s may be specified. --[no-]auto-maintenance, --[no-]auto-gc Run git maintenance run --auto at the end to perform automatic repository maintenance if needed. (--[no-]auto-gc is a synonym.) This is enabled by default. --[no-]write-commit-graph Write a commit-graph after fetching. This overrides the config setting fetch.writeCommitGraph."
            },
            {
                "flag": "",
                "long": "--prefetch",
                "arg": null,
                "description": "Modify the configured refspec to place all refs into the refs/prefetch/ namespace. See the prefetch task in git- maintenance(1)."
            },
            {
                "flag": "-p",
                "long": "--prune",
                "arg": null,
                "description": "Before fetching, remove any remote-tracking references that no longer exist on the remote. Tags are not subject to pruning if they are fetched only because of the default tag auto-following or due to a --tags option. However, if tags are fetched due to an explicit refspec (either on the command line or in the remote configuration, for example if the remote was cloned with the --mirror option), then they are also subject to pruning. Supplying --prune-tags is a shorthand for providing the tag refspec. See the PRUNING section below for more details."
            },
            {
                "flag": "-P",
                "long": "--prune-tags",
                "arg": null,
                "description": "Before fetching, remove any local tags that no longer exist on the remote if --prune is enabled. This option should be used more carefully, unlike --prune it will remove any local references (local tags) that have been created. This option is a shorthand for providing the explicit tag refspec along with --prune, see the discussion about that in its documentation. See the PRUNING section below for more details."
            },
            {
                "flag": "-n",
                "long": "--no-tags",
                "arg": null,
                "description": "By default, tags that point at objects that are downloaded from the remote repository are fetched and stored locally. This option disables this automatic tag following. The default behavior for a remote may be specified with the remote.<name>.tagOpt setting. See git-config(1). --refmap=<refspec> When fetching refs listed on the command line, use the specified refspec (can be given more than once) to map the refs to remote-tracking branches, instead of the values of remote.*.fetch configuration variables for the remote repository. Providing an empty <refspec> to the --refmap option causes Git to ignore the configured refspecs and rely entirely on the refspecs supplied as command-line arguments. See section on \"Configured Remote-tracking Branches\" for details."
            },
            {
                "flag": "-t",
                "long": "--tags",
                "arg": null,
                "description": "Fetch all tags from the remote (i.e., fetch remote tags refs/tags/* into local tags with the same name), in addition to whatever else would otherwise be fetched. Using this option alone does not subject tags to pruning, even if --prune is used (though tags may be pruned anyway if they are also the destination of an explicit refspec; see --prune)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "This option controls if and under what conditions new commits of populated submodules should be fetched too. It can be used as a boolean option to completely disable recursion when set to no or to unconditionally recurse into all populated submodules when set to yes, which is the default when this option is used without any value. Use on-demand to only recurse into a populated submodule when the superproject retrieves a commit that updates the submodule's reference to a commit that isn't already in the local submodule clone. By default, on-demand is used, unless fetch.recurseSubmodules is set (see git-config(1)). -j, --jobs=<n> Number of parallel children to be used for all forms of fetching. If the --multiple option was specified, the different remotes will be fetched in parallel. If multiple submodules are fetched, they will be fetched in parallel. To control them independently, use the config settings fetch.parallel and submodule.fetchJobs (see git- config(1)). Typically, parallel recursive and multi-remote fetches will be faster. By default fetches are performed sequentially, not in parallel."
            },
            {
                "flag": "",
                "long": "--no-recurse-submodules",
                "arg": null,
                "description": "Disable recursive fetching of submodules (this has the same effect as using the --recurse-submodules=no option)."
            },
            {
                "flag": "",
                "long": "--set-upstream",
                "arg": null,
                "description": "If the remote is fetched successfully, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands. For more information, see branch.<name>.merge and branch.<name>.remote in git-config(1). --submodule-prefix=<path> Prepend <path> to paths printed in informative messages such as \"Fetching submodule foo\". This option is used internally when recursing over submodules. --recurse-submodules-default=[yes|on-demand] This option is used internally to temporarily provide a non-negative default value for the --recurse-submodules option. All other methods of configuring fetch's submodule recursion (such as settings in gitmodules(5) and git-config(1)) override this option, as does specifying --[no-]recurse-submodules directly."
            },
            {
                "flag": "-u",
                "long": "--update-head-ok",
                "arg": null,
                "description": "By default git fetch refuses to update the head which corresponds to the current branch. This flag disables the check. This is purely for the internal use for git pull to communicate with git fetch, and unless you are implementing your own Porcelain you are not supposed to use it."
            },
            {
                "flag": "",
                "long": "--upload-pack",
                "arg": "<upload-pack>",
                "description": "When given, and the repository to fetch from is handled by git fetch-pack, --exec=<upload-pack> is passed to the command to specify non-default path for the command run on the other end."
            },
            {
                "flag": "-q",
                "long": "--quiet",
                "arg": null,
                "description": "Pass --quiet to git-fetch-pack and silence any other internally used git commands. Progress is not reported to the standard error stream."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Be verbose."
            },
            {
                "flag": "",
                "long": "--progress",
                "arg": null,
                "description": "Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal. -o <option>, --server-option=<option> Transmit the given string to the server when communicating using protocol version 2. The given string must not contain a NUL or LF character. The server's handling of server options, including unknown ones, is server-specific. When multiple --server-option=<option> are given, they are all sent to the other side in the order listed on the command line."
            },
            {
                "flag": "",
                "long": "--show-forced-updates",
                "arg": null,
                "description": "By default, git checks if a branch is force-updated during fetch. This can be disabled through fetch.showForcedUpdates, but the --show-forced-updates option guarantees this check occurs. See git- config(1)."
            },
            {
                "flag": "",
                "long": "--no-show-forced-updates",
                "arg": null,
                "description": "By default, git checks if a branch is force-updated during fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates to false to skip this check for performance reasons. If used during git-pull the --ff-only option will still check for forced updates before attempting a fast-forward update. See git-config(1). -4, --ipv4 Use IPv4 addresses only, ignoring IPv6 addresses. -6, --ipv6 Use IPv6 addresses only, ignoring IPv4 addresses. <repository> The \"remote\" repository that is the source of a fetch or pull operation. This parameter can be either a URL (see the section GIT URLS below) or the name of a remote (see the section REMOTES below). <group> A name referring to a list of repositories as the value of remotes.<group> in the configuration file. (See git-config(1)). <refspec> Specifies which refs to fetch and which local refs to update. When no <refspec>s appear on the command line, the refs to fetch are read from remote.<repository>.fetch variables instead (see CONFIGURED REMOTE-TRACKING BRANCHES below). The format of a <refspec> parameter is an optional plus +, followed by the source <src>, followed by a colon :, followed by the destination ref <dst>. The colon can be omitted when <dst> is empty. <src> is typically a ref, but it can also be a fully spelled hex object name. A <refspec> may contain a * in its <src> to indicate a simple pattern match. Such a refspec functions like a glob that matches any ref with the same prefix. A pattern <refspec> must have a * in both the <src> and <dst>. It will map refs to the destination by replacing the * with the contents matched from the source. If a refspec is prefixed by ^, it will be interpreted as a negative refspec. Rather than specifying which refs to fetch or which local refs to update, such a refspec will instead specify refs to exclude. A ref will be considered to match if it matches at least one positive refspec, and does not match any negative refspec. Negative refspecs can be useful to restrict the scope of a pattern refspec so that it will not include specific refs. Negative refspecs can themselves be pattern refspecs. However, they may only contain a <src> and do not specify a <dst>. Fully spelled out hex object names are also not supported. tag <tag> means the same as refs/tags/<tag>:refs/tags/<tag>; it requests fetching everything up to the given tag. The remote ref that matches <src> is fetched, and if <dst> is not an empty string, an attempt is made to update the local ref that matches it. Whether that update is allowed without --force depends on the ref namespace it's being fetched to, the type of object being fetched, and whether the update is considered to be a fast-forward. Generally, the same rules apply for fetching as when pushing, see the <refspec>... section of git-push(1) for what those are. Exceptions to those rules particular to git fetch are noted below. Until Git version 2.20, and unlike when pushing with git-push(1), any updates to refs/tags/* would be accepted without + in the refspec (or --force). When fetching, we promiscuously considered all tag updates from a remote to be forced fetches. Since Git version 2.20, fetching to update refs/tags/* works the same way as when pushing. I.e. any updates will be rejected without + in the refspec (or --force). Unlike when pushing with git-push(1), any updates outside of refs/{tags,heads}/* will be accepted without + in the refspec (or --force), whether that's swapping e.g. a tree object for a blob, or a commit for another commit that's doesn't have the previous commit as an ancestor etc. Unlike when pushing with git-push(1), there is no configuration which'll amend these rules, and nothing like a pre-fetch hook analogous to the pre-receive hook. As with pushing with git-push(1), all of the rules described above about what's not allowed as an update can be overridden by adding an the optional leading + to a refspec (or using --force command line option). The only exception to this is that no amount of forcing will make the refs/heads/* namespace accept a non-commit object. Note When the remote branch you want to fetch is known to be rewound and rebased regularly, it is expected that its new tip will not be descendant of its previous tip (as stored in your remote-tracking branch the last time you fetched). You would want to use the + sign to indicate non-fast-forward updates will be needed for such branches. There is no way to determine or declare that a branch will be made available in a repository with this behavior; the pulling user simply must know this is the expected usage pattern for a branch."
            },
            {
                "flag": "",
                "long": "--stdin",
                "arg": null,
                "description": "Read refspecs, one per line, from stdin in addition to those provided as arguments. The \"tag <name>\" format is not supported."
            }
        ],
        "examples": [
            "o   Update the remote-tracking branches:",
            "$ git fetch origin",
            "The above command copies all branches from the remote refs/heads/",
            "namespace and stores them to the local refs/remotes/origin/",
            "namespace, unless the branch.<name>.fetch option is used to specify",
            "a non-default refspec.",
            "o   Using refspecs explicitly:",
            "$ git fetch origin +seen:seen maint:tmp",
            "This updates (or creates, as necessary) branches seen and tmp in",
            "the local repository by fetching from the branches (respectively)",
            "seen and maint from the remote repository.",
            "The seen branch will be updated even if it does not fast-forward,",
            "because it is prefixed with a plus sign; tmp will not be.",
            "o   Peek at a remote's branch, without configuring the remote in your",
            "local repository:",
            "$ git fetch git://git.kernel.org/pub/scm/git/git.git maint",
            "$ git log FETCHHEAD",
            "The first command fetches the maint branch from the repository at",
            "git://git.kernel.org/pub/scm/git/git.git and the second command",
            "uses FETCHHEAD to examine the branch with git-log(1). The fetched",
            "objects will eventually be removed by git's built-in housekeeping",
            "(see git-gc(1))."
        ],
        "see_also": [
            {
                "name": "git-pull",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-pull/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "--all",
                        "lines": 2,
                        "long": "--all"
                    },
                    {
                        "name": "-a, --append",
                        "lines": 4,
                        "flag": "-a",
                        "long": "--append"
                    },
                    {
                        "name": "--atomic",
                        "lines": 24,
                        "long": "--atomic"
                    },
                    {
                        "name": "--unshallow",
                        "lines": 8,
                        "long": "--unshallow"
                    },
                    {
                        "name": "--update-shallow",
                        "lines": 24,
                        "long": "--update-shallow"
                    },
                    {
                        "name": "--negotiate-only",
                        "lines": 7,
                        "long": "--negotiate-only"
                    },
                    {
                        "name": "--dry-run",
                        "lines": 8,
                        "long": "--dry-run"
                    },
                    {
                        "name": "-f, --force",
                        "lines": 4,
                        "flag": "-f",
                        "long": "--force"
                    },
                    {
                        "name": "-k, --keep",
                        "lines": 2,
                        "flag": "-k",
                        "long": "--keep"
                    },
                    {
                        "name": "--multiple",
                        "lines": 12,
                        "long": "--multiple"
                    },
                    {
                        "name": "--prefetch",
                        "lines": 4,
                        "long": "--prefetch"
                    },
                    {
                        "name": "-p, --prune",
                        "lines": 11,
                        "flag": "-p",
                        "long": "--prune"
                    },
                    {
                        "name": "-P, --prune-tags",
                        "lines": 9,
                        "flag": "-P",
                        "long": "--prune-tags"
                    },
                    {
                        "name": "-n, --no-tags",
                        "lines": 16,
                        "flag": "-n",
                        "long": "--no-tags"
                    },
                    {
                        "name": "-t, --tags",
                        "lines": 7,
                        "flag": "-t",
                        "long": "--tags"
                    },
                    {
                        "name": "--recurse-submodules[=yes|on-demand|no]",
                        "lines": 24
                    },
                    {
                        "name": "--no-recurse-submodules",
                        "lines": 3,
                        "long": "--no-recurse-submodules"
                    },
                    {
                        "name": "--set-upstream",
                        "lines": 17,
                        "long": "--set-upstream"
                    },
                    {
                        "name": "-u, --update-head-ok",
                        "lines": 6,
                        "flag": "-u",
                        "long": "--update-head-ok"
                    },
                    {
                        "name": "--upload-pack <upload-pack>",
                        "lines": 4,
                        "long": "--upload-pack",
                        "arg": "<upload-pack>"
                    },
                    {
                        "name": "-q, --quiet",
                        "lines": 4,
                        "flag": "-q",
                        "long": "--quiet"
                    },
                    {
                        "name": "-v, --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "--progress",
                        "lines": 13,
                        "long": "--progress"
                    },
                    {
                        "name": "--show-forced-updates",
                        "lines": 5,
                        "long": "--show-forced-updates"
                    },
                    {
                        "name": "--no-show-forced-updates",
                        "lines": 101,
                        "long": "--no-show-forced-updates"
                    },
                    {
                        "name": "--stdin",
                        "lines": 3,
                        "long": "--stdin"
                    }
                ]
            },
            {
                "name": "GIT URLS",
                "lines": 94,
                "subsections": []
            },
            {
                "name": "REMOTES",
                "lines": 64,
                "subsections": []
            },
            {
                "name": "CONFIGURED REMOTE-TRACKING BRANCHES",
                "lines": 40,
                "subsections": []
            },
            {
                "name": "PRUNING",
                "lines": 75,
                "subsections": []
            },
            {
                "name": "OUTPUT",
                "lines": 61,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 32,
                "subsections": []
            },
            {
                "name": "SECURITY",
                "lines": 31,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "git-fetch - Download objects and refs from another repository\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git fetch [<options>] [<repository> [<refspec>...]]\ngit fetch [<options>] <group>\ngit fetch --multiple [<options>] [(<repository> | <group>)...]\ngit fetch --all [<options>]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Fetch branches and/or tags (collectively, \"refs\") from one or more\nother repositories, along with the objects necessary to complete their\nhistories. Remote-tracking branches are updated (see the description of\n<refspec> below for ways to control this behavior).\n\nBy default, any tag that points into the histories being fetched is\nalso fetched; the effect is to fetch tags that point at branches that\nyou are interested in. This default behavior can be changed by using\nthe --tags or --no-tags options or by configuring remote.<name>.tagOpt.\nBy using a refspec that fetches tags explicitly, you can fetch tags\nthat do not point into branches you are interested in as well.\n\ngit fetch can fetch from either a single named repository or URL, or\nfrom several repositories at once if <group> is given and there is a\nremotes.<group> entry in the configuration file. (See git-config(1)).\n\nWhen no remote is specified, by default the origin remote will be used,\nunless there's an upstream branch configured for the current branch.\n\nThe names of refs that are fetched, together with the object names they\npoint at, are written to .git/FETCHHEAD. This information may be used\nby scripts or other git commands, such as git-pull(1).\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "--all",
                        "content": "Fetch all remotes.\n",
                        "long": "--all"
                    },
                    {
                        "name": "-a, --append",
                        "content": "Append ref names and object names of fetched refs to the existing\ncontents of .git/FETCHHEAD. Without this option old data in\n.git/FETCHHEAD will be overwritten.\n",
                        "flag": "-a",
                        "long": "--append"
                    },
                    {
                        "name": "--atomic",
                        "content": "Use an atomic transaction to update local refs. Either all refs are\nupdated, or on error, no refs are updated.\n\n--depth=<depth>\nLimit fetching to the specified number of commits from the tip of\neach remote branch history. If fetching to a shallow repository\ncreated by git clone with --depth=<depth> option (see git-\nclone(1)), deepen or shorten the history to the specified number of\ncommits. Tags for the deepened commits are not fetched.\n\n--deepen=<depth>\nSimilar to --depth, except it specifies the number of commits from\nthe current shallow boundary instead of from the tip of each remote\nbranch history.\n\n--shallow-since=<date>\nDeepen or shorten the history of a shallow repository to include\nall reachable commits after <date>.\n\n--shallow-exclude=<revision>\nDeepen or shorten the history of a shallow repository to exclude\ncommits reachable from a specified remote branch or tag. This\noption can be specified multiple times.\n",
                        "long": "--atomic"
                    },
                    {
                        "name": "--unshallow",
                        "content": "If the source repository is complete, convert a shallow repository\nto a complete one, removing all the limitations imposed by shallow\nrepositories.\n\nIf the source repository is shallow, fetch as much as possible so\nthat the current repository has the same history as the source\nrepository.\n",
                        "long": "--unshallow"
                    },
                    {
                        "name": "--update-shallow",
                        "content": "By default when fetching from a shallow repository, git fetch\nrefuses refs that require updating .git/shallow. This option\nupdates .git/shallow and accept such refs.\n\n--negotiation-tip=<commit|glob>\nBy default, Git will report, to the server, commits reachable from\nall local refs to find common commits in an attempt to reduce the\nsize of the to-be-received packfile. If specified, Git will only\nreport commits reachable from the given tips. This is useful to\nspeed up fetches when the user knows which local ref is likely to\nhave commits in common with the upstream ref being fetched.\n\nThis option may be specified more than once; if so, Git will report\ncommits reachable from any of the given commits.\n\nThe argument to this option may be a glob on ref names, a ref, or\nthe (possibly abbreviated) SHA-1 of a commit. Specifying a glob is\nequivalent to specifying this option multiple times, one for each\nmatching ref name.\n\nSee also the fetch.negotiationAlgorithm and push.negotiate\nconfiguration variables documented in git-config(1), and the\n--negotiate-only option below.\n",
                        "long": "--update-shallow"
                    },
                    {
                        "name": "--negotiate-only",
                        "content": "Do not fetch anything from the server, and instead print the\nancestors of the provided --negotiation-tip=* arguments, which we\nhave in common with the server.\n\nInternally this is used to implement the push.negotiate option, see\ngit-config(1).\n",
                        "long": "--negotiate-only"
                    },
                    {
                        "name": "--dry-run",
                        "content": "Show what would be done, without making any changes.\n\n--[no-]write-fetch-head\nWrite the list of remote refs fetched in the FETCHHEAD file\ndirectly under $GITDIR. This is the default. Passing\n--no-write-fetch-head from the command line tells Git not to write\nthe file. Under --dry-run option, the file is never written.\n",
                        "long": "--dry-run"
                    },
                    {
                        "name": "-f, --force",
                        "content": "When git fetch is used with <src>:<dst> refspec it may refuse to\nupdate the local branch as discussed in the <refspec> part below.\nThis option overrides that check.\n",
                        "flag": "-f",
                        "long": "--force"
                    },
                    {
                        "name": "-k, --keep",
                        "content": "Keep downloaded pack.\n",
                        "flag": "-k",
                        "long": "--keep"
                    },
                    {
                        "name": "--multiple",
                        "content": "Allow several <repository> and <group> arguments to be specified.\nNo <refspec>s may be specified.\n\n--[no-]auto-maintenance, --[no-]auto-gc\nRun git maintenance run --auto at the end to perform automatic\nrepository maintenance if needed. (--[no-]auto-gc is a synonym.)\nThis is enabled by default.\n\n--[no-]write-commit-graph\nWrite a commit-graph after fetching. This overrides the config\nsetting fetch.writeCommitGraph.\n",
                        "long": "--multiple"
                    },
                    {
                        "name": "--prefetch",
                        "content": "Modify the configured refspec to place all refs into the\nrefs/prefetch/ namespace. See the prefetch task in git-\nmaintenance(1).\n",
                        "long": "--prefetch"
                    },
                    {
                        "name": "-p, --prune",
                        "content": "Before fetching, remove any remote-tracking references that no\nlonger exist on the remote. Tags are not subject to pruning if they\nare fetched only because of the default tag auto-following or due\nto a --tags option. However, if tags are fetched due to an explicit\nrefspec (either on the command line or in the remote configuration,\nfor example if the remote was cloned with the --mirror option),\nthen they are also subject to pruning. Supplying --prune-tags is a\nshorthand for providing the tag refspec.\n\nSee the PRUNING section below for more details.\n",
                        "flag": "-p",
                        "long": "--prune"
                    },
                    {
                        "name": "-P, --prune-tags",
                        "content": "Before fetching, remove any local tags that no longer exist on the\nremote if --prune is enabled. This option should be used more\ncarefully, unlike --prune it will remove any local references\n(local tags) that have been created. This option is a shorthand for\nproviding the explicit tag refspec along with --prune, see the\ndiscussion about that in its documentation.\n\nSee the PRUNING section below for more details.\n",
                        "flag": "-P",
                        "long": "--prune-tags"
                    },
                    {
                        "name": "-n, --no-tags",
                        "content": "By default, tags that point at objects that are downloaded from the\nremote repository are fetched and stored locally. This option\ndisables this automatic tag following. The default behavior for a\nremote may be specified with the remote.<name>.tagOpt setting. See\ngit-config(1).\n\n--refmap=<refspec>\nWhen fetching refs listed on the command line, use the specified\nrefspec (can be given more than once) to map the refs to\nremote-tracking branches, instead of the values of remote.*.fetch\nconfiguration variables for the remote repository. Providing an\nempty <refspec> to the --refmap option causes Git to ignore the\nconfigured refspecs and rely entirely on the refspecs supplied as\ncommand-line arguments. See section on \"Configured Remote-tracking\nBranches\" for details.\n",
                        "flag": "-n",
                        "long": "--no-tags"
                    },
                    {
                        "name": "-t, --tags",
                        "content": "Fetch all tags from the remote (i.e., fetch remote tags refs/tags/*\ninto local tags with the same name), in addition to whatever else\nwould otherwise be fetched. Using this option alone does not\nsubject tags to pruning, even if --prune is used (though tags may\nbe pruned anyway if they are also the destination of an explicit\nrefspec; see --prune).\n",
                        "flag": "-t",
                        "long": "--tags"
                    },
                    {
                        "name": "--recurse-submodules[=yes|on-demand|no]",
                        "content": "This option controls if and under what conditions new commits of\npopulated submodules should be fetched too. It can be used as a\nboolean option to completely disable recursion when set to no or to\nunconditionally recurse into all populated submodules when set to\nyes, which is the default when this option is used without any\nvalue. Use on-demand to only recurse into a populated submodule\nwhen the superproject retrieves a commit that updates the\nsubmodule's reference to a commit that isn't already in the local\nsubmodule clone. By default, on-demand is used, unless\nfetch.recurseSubmodules is set (see git-config(1)).\n\n-j, --jobs=<n>\nNumber of parallel children to be used for all forms of fetching.\n\nIf the --multiple option was specified, the different remotes will\nbe fetched in parallel. If multiple submodules are fetched, they\nwill be fetched in parallel. To control them independently, use the\nconfig settings fetch.parallel and submodule.fetchJobs (see git-\nconfig(1)).\n\nTypically, parallel recursive and multi-remote fetches will be\nfaster. By default fetches are performed sequentially, not in\nparallel.\n"
                    },
                    {
                        "name": "--no-recurse-submodules",
                        "content": "Disable recursive fetching of submodules (this has the same effect\nas using the --recurse-submodules=no option).\n",
                        "long": "--no-recurse-submodules"
                    },
                    {
                        "name": "--set-upstream",
                        "content": "If the remote is fetched successfully, add upstream (tracking)\nreference, used by argument-less git-pull(1) and other commands.\nFor more information, see branch.<name>.merge and\nbranch.<name>.remote in git-config(1).\n\n--submodule-prefix=<path>\nPrepend <path> to paths printed in informative messages such as\n\"Fetching submodule foo\". This option is used internally when\nrecursing over submodules.\n\n--recurse-submodules-default=[yes|on-demand]\nThis option is used internally to temporarily provide a\nnon-negative default value for the --recurse-submodules option. All\nother methods of configuring fetch's submodule recursion (such as\nsettings in gitmodules(5) and git-config(1)) override this option,\nas does specifying --[no-]recurse-submodules directly.\n",
                        "long": "--set-upstream"
                    },
                    {
                        "name": "-u, --update-head-ok",
                        "content": "By default git fetch refuses to update the head which corresponds\nto the current branch. This flag disables the check. This is purely\nfor the internal use for git pull to communicate with git fetch,\nand unless you are implementing your own Porcelain you are not\nsupposed to use it.\n",
                        "flag": "-u",
                        "long": "--update-head-ok"
                    },
                    {
                        "name": "--upload-pack <upload-pack>",
                        "content": "When given, and the repository to fetch from is handled by git\nfetch-pack, --exec=<upload-pack> is passed to the command to\nspecify non-default path for the command run on the other end.\n",
                        "long": "--upload-pack",
                        "arg": "<upload-pack>"
                    },
                    {
                        "name": "-q, --quiet",
                        "content": "Pass --quiet to git-fetch-pack and silence any other internally\nused git commands. Progress is not reported to the standard error\nstream.\n",
                        "flag": "-q",
                        "long": "--quiet"
                    },
                    {
                        "name": "-v, --verbose",
                        "content": "Be verbose.\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "--progress",
                        "content": "Progress status is reported on the standard error stream by default\nwhen it is attached to a terminal, unless -q is specified. This\nflag forces progress status even if the standard error stream is\nnot directed to a terminal.\n\n-o <option>, --server-option=<option>\nTransmit the given string to the server when communicating using\nprotocol version 2. The given string must not contain a NUL or LF\ncharacter. The server's handling of server options, including\nunknown ones, is server-specific. When multiple\n--server-option=<option> are given, they are all sent to the other\nside in the order listed on the command line.\n",
                        "long": "--progress"
                    },
                    {
                        "name": "--show-forced-updates",
                        "content": "By default, git checks if a branch is force-updated during fetch.\nThis can be disabled through fetch.showForcedUpdates, but the\n--show-forced-updates option guarantees this check occurs. See git-\nconfig(1).\n",
                        "long": "--show-forced-updates"
                    },
                    {
                        "name": "--no-show-forced-updates",
                        "content": "By default, git checks if a branch is force-updated during fetch.\nPass --no-show-forced-updates or set fetch.showForcedUpdates to\nfalse to skip this check for performance reasons. If used during\ngit-pull the --ff-only option will still check for forced updates\nbefore attempting a fast-forward update. See git-config(1).\n\n-4, --ipv4\nUse IPv4 addresses only, ignoring IPv6 addresses.\n\n-6, --ipv6\nUse IPv6 addresses only, ignoring IPv4 addresses.\n\n<repository>\nThe \"remote\" repository that is the source of a fetch or pull\noperation. This parameter can be either a URL (see the section GIT\nURLS below) or the name of a remote (see the section REMOTES\nbelow).\n\n<group>\nA name referring to a list of repositories as the value of\nremotes.<group> in the configuration file. (See git-config(1)).\n\n<refspec>\nSpecifies which refs to fetch and which local refs to update. When\nno <refspec>s appear on the command line, the refs to fetch are\nread from remote.<repository>.fetch variables instead (see\nCONFIGURED REMOTE-TRACKING BRANCHES below).\n\nThe format of a <refspec> parameter is an optional plus +, followed\nby the source <src>, followed by a colon :, followed by the\ndestination ref <dst>. The colon can be omitted when <dst> is\nempty. <src> is typically a ref, but it can also be a fully spelled\nhex object name.\n\nA <refspec> may contain a * in its <src> to indicate a simple\npattern match. Such a refspec functions like a glob that matches\nany ref with the same prefix. A pattern <refspec> must have a * in\nboth the <src> and <dst>. It will map refs to the destination by\nreplacing the * with the contents matched from the source.\n\nIf a refspec is prefixed by ^, it will be interpreted as a negative\nrefspec. Rather than specifying which refs to fetch or which local\nrefs to update, such a refspec will instead specify refs to\nexclude. A ref will be considered to match if it matches at least\none positive refspec, and does not match any negative refspec.\nNegative refspecs can be useful to restrict the scope of a pattern\nrefspec so that it will not include specific refs. Negative\nrefspecs can themselves be pattern refspecs. However, they may only\ncontain a <src> and do not specify a <dst>. Fully spelled out hex\nobject names are also not supported.\n\ntag <tag> means the same as refs/tags/<tag>:refs/tags/<tag>; it\nrequests fetching everything up to the given tag.\n\nThe remote ref that matches <src> is fetched, and if <dst> is not\nan empty string, an attempt is made to update the local ref that\nmatches it.\n\nWhether that update is allowed without --force depends on the ref\nnamespace it's being fetched to, the type of object being fetched,\nand whether the update is considered to be a fast-forward.\nGenerally, the same rules apply for fetching as when pushing, see\nthe <refspec>...  section of git-push(1) for what those are.\nExceptions to those rules particular to git fetch are noted below.\n\nUntil Git version 2.20, and unlike when pushing with git-push(1),\nany updates to refs/tags/* would be accepted without + in the\nrefspec (or --force). When fetching, we promiscuously considered\nall tag updates from a remote to be forced fetches. Since Git\nversion 2.20, fetching to update refs/tags/* works the same way as\nwhen pushing. I.e. any updates will be rejected without + in the\nrefspec (or --force).\n\nUnlike when pushing with git-push(1), any updates outside of\nrefs/{tags,heads}/* will be accepted without + in the refspec (or\n--force), whether that's swapping e.g. a tree object for a blob, or\na commit for another commit that's doesn't have the previous commit\nas an ancestor etc.\n\nUnlike when pushing with git-push(1), there is no configuration\nwhich'll amend these rules, and nothing like a pre-fetch hook\nanalogous to the pre-receive hook.\n\nAs with pushing with git-push(1), all of the rules described above\nabout what's not allowed as an update can be overridden by adding\nan the optional leading + to a refspec (or using --force command\nline option). The only exception to this is that no amount of\nforcing will make the refs/heads/* namespace accept a non-commit\nobject.\n\nNote\nWhen the remote branch you want to fetch is known to be rewound\nand rebased regularly, it is expected that its new tip will not\nbe descendant of its previous tip (as stored in your\nremote-tracking branch the last time you fetched). You would\nwant to use the + sign to indicate non-fast-forward updates\nwill be needed for such branches. There is no way to determine\nor declare that a branch will be made available in a repository\nwith this behavior; the pulling user simply must know this is\nthe expected usage pattern for a branch.\n",
                        "long": "--no-show-forced-updates"
                    },
                    {
                        "name": "--stdin",
                        "content": "Read refspecs, one per line, from stdin in addition to those\nprovided as arguments. The \"tag <name>\" format is not supported.\n",
                        "long": "--stdin"
                    }
                ]
            },
            "GIT URLS": {
                "content": "In general, URLs contain information about the transport protocol, the\naddress of the remote server, and the path to the repository. Depending\non the transport protocol, some of this information may be absent.\n\nGit supports ssh, git, http, and https protocols (in addition, ftp, and\nftps can be used for fetching, but this is inefficient and deprecated;\ndo not use it).\n\nThe native transport (i.e. git:// URL) does no authentication and\nshould be used with caution on unsecured networks.\n\nThe following syntaxes may be used with them:\n\no   ssh://[user@]host.xz[:port]/path/to/repo.git/\n\no   git://host.xz[:port]/path/to/repo.git/\n\no   http[s]://host.xz[:port]/path/to/repo.git/\n\no   ftp[s]://host.xz[:port]/path/to/repo.git/\n\nAn alternative scp-like syntax may also be used with the ssh protocol:\n\no   [user@]host.xz:path/to/repo.git/\n\nThis syntax is only recognized if there are no slashes before the first\ncolon. This helps differentiate a local path that contains a colon. For\nexample the local path foo:bar could be specified as an absolute path\nor ./foo:bar to avoid being misinterpreted as an ssh url.\n\nThe ssh and git protocols additionally support ~username expansion:\n\no   ssh://[user@]host.xz[:port]/~[user]/path/to/repo.git/\n\no   git://host.xz[:port]/~[user]/path/to/repo.git/\n\no   [user@]host.xz:/~[user]/path/to/repo.git/\n\nFor local repositories, also supported by Git natively, the following\nsyntaxes may be used:\n\no   /path/to/repo.git/\n\no   file:///path/to/repo.git/\n\nThese two syntaxes are mostly equivalent, except when cloning, when the\nformer implies --local option. See git-clone(1) for details.\n\ngit clone, git fetch and git pull, but not git push, will also accept a\nsuitable bundle file. See git-bundle(1).\n\nWhen Git doesn't know how to handle a certain transport protocol, it\nattempts to use the remote-<transport> remote helper, if one exists. To\nexplicitly request a remote helper, the following syntax may be used:\n\no   <transport>::<address>\n\nwhere <address> may be a path, a server and path, or an arbitrary\nURL-like string recognized by the specific remote helper being invoked.\nSee gitremote-helpers(7) for details.\n\nIf there are a large number of similarly-named remote repositories and\nyou want to use a different format for them (such that the URLs you use\nwill be rewritten into URLs that work), you can create a configuration\nsection of the form:\n\n[url \"<actual url base>\"]\ninsteadOf = <other url base>\n\nFor example, with this:\n\n[url \"git://git.host.xz/\"]\ninsteadOf = host.xz:/path/to/\ninsteadOf = work:\n\na URL like \"work:repo.git\" or like \"host.xz:/path/to/repo.git\" will be\nrewritten in any context that takes a URL to be\n\"git://git.host.xz/repo.git\".\n\nIf you want to rewrite URLs for push only, you can create a\nconfiguration section of the form:\n\n[url \"<actual url base>\"]\npushInsteadOf = <other url base>\n\nFor example, with this:\n\n[url \"ssh://example.org/\"]\npushInsteadOf = git://example.org/\n\na URL like \"git://example.org/path/to/repo.git\" will be rewritten to\n\"ssh://example.org/path/to/repo.git\" for pushes, but pulls will still\nuse the original URL.\n",
                "subsections": []
            },
            "REMOTES": {
                "content": "The name of one of the following can be used instead of a URL as\n<repository> argument:\n\no   a remote in the Git configuration file: $GITDIR/config,\n\no   a file in the $GITDIR/remotes directory, or\n\no   a file in the $GITDIR/branches directory.\n\nAll of these also allow you to omit the refspec from the command line\nbecause they each contain a refspec which git will use by default.\n\nNamed remote in configuration file\nYou can choose to provide the name of a remote which you had previously\nconfigured using git-remote(1), git-config(1) or even by a manual edit\nto the $GITDIR/config file. The URL of this remote will be used to\naccess the repository. The refspec of this remote will be used by\ndefault when you do not provide a refspec on the command line. The\nentry in the config file would appear like this:\n\n[remote \"<name>\"]\nurl = <url>\npushurl = <pushurl>\npush = <refspec>\nfetch = <refspec>\n\nThe <pushurl> is used for pushes only. It is optional and defaults to\n<url>.\n\nNamed file in $GITDIR/remotes\nYou can choose to provide the name of a file in $GITDIR/remotes. The\nURL in this file will be used to access the repository. The refspec in\nthis file will be used as default when you do not provide a refspec on\nthe command line. This file should have the following format:\n\nURL: one of the above URL format\nPush: <refspec>\nPull: <refspec>\n\nPush: lines are used by git push and Pull: lines are used by git pull\nand git fetch. Multiple Push: and Pull: lines may be specified for\nadditional branch mappings.\n\nNamed file in $GITDIR/branches\nYou can choose to provide the name of a file in $GITDIR/branches. The\nURL in this file will be used to access the repository. This file\nshould have the following format:\n\n<url>#<head>\n\n<url> is required; #<head> is optional.\n\nDepending on the operation, git will use one of the following refspecs,\nif you don't provide one on the command line. <branch> is the name of\nthis file in $GITDIR/branches and <head> defaults to master.\n\ngit fetch uses:\n\nrefs/heads/<head>:refs/heads/<branch>\n\ngit push uses:\n\nHEAD:refs/heads/<head>\n",
                "subsections": []
            },
            "CONFIGURED REMOTE-TRACKING BRANCHES": {
                "content": "You often interact with the same remote repository by regularly and\nrepeatedly fetching from it. In order to keep track of the progress of\nsuch a remote repository, git fetch allows you to configure\nremote.<repository>.fetch configuration variables.\n\nTypically such a variable may look like this:\n\n[remote \"origin\"]\nfetch = +refs/heads/*:refs/remotes/origin/*\n\nThis configuration is used in two ways:\n\no   When git fetch is run without specifying what branches and/or tags\nto fetch on the command line, e.g.  git fetch origin or git fetch,\nremote.<repository>.fetch values are used as the refspecs--they\nspecify which refs to fetch and which local refs to update. The\nexample above will fetch all branches that exist in the origin\n(i.e. any ref that matches the left-hand side of the value,\nrefs/heads/*) and update the corresponding remote-tracking branches\nin the refs/remotes/origin/* hierarchy.\n\no   When git fetch is run with explicit branches and/or tags to fetch\non the command line, e.g.  git fetch origin master, the <refspec>s\ngiven on the command line determine what are to be fetched (e.g.\nmaster in the example, which is a short-hand for master:, which in\nturn means \"fetch the master branch but I do not explicitly say\nwhat remote-tracking branch to update with it from the command\nline\"), and the example command will fetch only the master branch.\nThe remote.<repository>.fetch values determine which\nremote-tracking branch, if any, is updated. When used in this way,\nthe remote.<repository>.fetch values do not have any effect in\ndeciding what gets fetched (i.e. the values are not used as\nrefspecs when the command-line lists refspecs); they are only used\nto decide where the refs that are fetched are stored by acting as a\nmapping.\n\nThe latter use of the remote.<repository>.fetch values can be\noverridden by giving the --refmap=<refspec> parameter(s) on the command\nline.\n",
                "subsections": []
            },
            "PRUNING": {
                "content": "Git has a default disposition of keeping data unless it's explicitly\nthrown away; this extends to holding onto local references to branches\non remotes that have themselves deleted those branches.\n\nIf left to accumulate, these stale references might make performance\nworse on big and busy repos that have a lot of branch churn, and e.g.\nmake the output of commands like git branch -a --contains <commit>\nneedlessly verbose, as well as impacting anything else that'll work\nwith the complete set of known references.\n\nThese remote-tracking references can be deleted as a one-off with\neither of:\n\n# While fetching\n$ git fetch --prune <name>\n\n# Only prune, don't fetch\n$ git remote prune <name>\n\nTo prune references as part of your normal workflow without needing to\nremember to run that, set fetch.prune globally, or remote.<name>.prune\nper-remote in the config. See git-config(1).\n\nHere's where things get tricky and more specific. The pruning feature\ndoesn't actually care about branches, instead it'll prune local <-->\nremote-references as a function of the refspec of the remote (see\n<refspec> and CONFIGURED REMOTE-TRACKING BRANCHES above).\n\nTherefore if the refspec for the remote includes e.g.\nrefs/tags/*:refs/tags/*, or you manually run e.g. git fetch --prune\n<name> \"refs/tags/*:refs/tags/*\" it won't be stale remote tracking\nbranches that are deleted, but any local tag that doesn't exist on the\nremote.\n\nThis might not be what you expect, i.e. you want to prune remote\n<name>, but also explicitly fetch tags from it, so when you fetch from\nit you delete all your local tags, most of which may not have come from\nthe <name> remote in the first place.\n\nSo be careful when using this with a refspec like\nrefs/tags/*:refs/tags/*, or any other refspec which might map\nreferences from multiple remotes to the same local namespace.\n\nSince keeping up-to-date with both branches and tags on the remote is a\ncommon use-case the --prune-tags option can be supplied along with\n--prune to prune local tags that don't exist on the remote, and\nforce-update those tags that differ. Tag pruning can also be enabled\nwith fetch.pruneTags or remote.<name>.pruneTags in the config. See git-\nconfig(1).\n\nThe --prune-tags option is equivalent to having refs/tags/*:refs/tags/*\ndeclared in the refspecs of the remote. This can lead to some seemingly\nstrange interactions:\n\n# These both fetch tags\n$ git fetch --no-tags origin 'refs/tags/*:refs/tags/*'\n$ git fetch --no-tags --prune-tags origin\n\nThe reason it doesn't error out when provided without --prune or its\nconfig versions is for flexibility of the configured versions, and to\nmaintain a 1=1 mapping between what the command line flags do, and what\nthe configuration versions do.\n\nIt's reasonable to e.g. configure fetch.pruneTags=true in ~/.gitconfig\nto have tags pruned whenever git fetch --prune is run, without making\nevery invocation of git fetch without --prune an error.\n\nPruning tags with --prune-tags also works when fetching a URL instead\nof a named remote. These will all prune tags not found on origin:\n\n$ git fetch origin --prune --prune-tags\n$ git fetch origin --prune 'refs/tags/*:refs/tags/*'\n$ git fetch <url of origin> --prune --prune-tags\n$ git fetch <url of origin> --prune 'refs/tags/*:refs/tags/*'\n",
                "subsections": []
            },
            "OUTPUT": {
                "content": "The output of \"git fetch\" depends on the transport method used; this\nsection describes the output when fetching over the Git protocol\n(either locally or via ssh) and Smart HTTP protocol.\n\nThe status of the fetch is output in tabular form, with each line\nrepresenting the status of a single ref. Each line is of the form:\n\n<flag> <summary> <from> -> <to> [<reason>]\n\nThe status of up-to-date refs is shown only if the --verbose option is\nused.\n\nIn compact output mode, specified with configuration variable\nfetch.output, if either entire <from> or <to> is found in the other\nstring, it will be substituted with * in the other string. For example,\nmaster -> origin/master becomes master -> origin/*.\n\nflag\nA single character indicating the status of the ref:\n\n(space)\nfor a successfully fetched fast-forward;\n\n+\nfor a successful forced update;\n\n-\nfor a successfully pruned ref;\n\nt\nfor a successful tag update;\n\n*\nfor a successfully fetched new ref;\n\n!\nfor a ref that was rejected or failed to update; and\n\n=\nfor a ref that was up to date and did not need fetching.\n\nsummary\nFor a successfully fetched ref, the summary shows the old and new\nvalues of the ref in a form suitable for using as an argument to\ngit log (this is <old>..<new> in most cases, and <old>...<new> for\nforced non-fast-forward updates).\n\nfrom\nThe name of the remote ref being fetched from, minus its\nrefs/<type>/ prefix. In the case of deletion, the name of the\nremote ref is \"(none)\".\n\nto\nThe name of the local ref being updated, minus its refs/<type>/\nprefix.\n\nreason\nA human-readable explanation. In the case of successfully fetched\nrefs, no explanation is needed. For a failed ref, the reason for\nfailure is described.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "o   Update the remote-tracking branches:\n\n$ git fetch origin\n\nThe above command copies all branches from the remote refs/heads/\nnamespace and stores them to the local refs/remotes/origin/\nnamespace, unless the branch.<name>.fetch option is used to specify\na non-default refspec.\n\no   Using refspecs explicitly:\n\n$ git fetch origin +seen:seen maint:tmp\n\nThis updates (or creates, as necessary) branches seen and tmp in\nthe local repository by fetching from the branches (respectively)\nseen and maint from the remote repository.\n\nThe seen branch will be updated even if it does not fast-forward,\nbecause it is prefixed with a plus sign; tmp will not be.\n\no   Peek at a remote's branch, without configuring the remote in your\nlocal repository:\n\n$ git fetch git://git.kernel.org/pub/scm/git/git.git maint\n$ git log FETCHHEAD\n\nThe first command fetches the maint branch from the repository at\ngit://git.kernel.org/pub/scm/git/git.git and the second command\nuses FETCHHEAD to examine the branch with git-log(1). The fetched\nobjects will eventually be removed by git's built-in housekeeping\n(see git-gc(1)).\n",
                "subsections": []
            },
            "SECURITY": {
                "content": "The fetch and push protocols are not designed to prevent one side from\nstealing data from the other repository that was not intended to be\nshared. If you have private data that you need to protect from a\nmalicious peer, your best option is to store it in another repository.\nThis applies to both clients and servers. In particular, namespaces on\na server are not effective for read access control; you should only\ngrant read access to a namespace to clients that you would trust with\nread access to the entire repository.\n\nThe known attack vectors are as follows:\n\n1. The victim sends \"have\" lines advertising the IDs of objects it has\nthat are not explicitly intended to be shared but can be used to\noptimize the transfer if the peer also has them. The attacker\nchooses an object ID X to steal and sends a ref to X, but isn't\nrequired to send the content of X because the victim already has\nit. Now the victim believes that the attacker has X, and it sends\nthe content of X back to the attacker later. (This attack is most\nstraightforward for a client to perform on a server, by creating a\nref to X in the namespace the client has access to and then\nfetching it. The most likely way for a server to perform it on a\nclient is to \"merge\" X into a public branch and hope that the user\ndoes additional work on this branch and pushes it back to the\nserver without noticing the merge.)\n\n2. As in #1, the attacker chooses an object ID X to steal. The victim\nsends an object Y that the attacker already has, and the attacker\nfalsely claims to have X and not Y, so the victim sends Y as a\ndelta against X. The delta reveals regions of X that are similar to\nY to the attacker.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Using --recurse-submodules can only fetch new commits in already\nchecked out submodules right now. When e.g. upstream added a new\nsubmodule in the just fetched commits of the superproject the submodule\nitself cannot be fetched, making it impossible to check out that\nsubmodule later without having to do a fetch again. This is expected to\nbe fixed in a future Git version.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "git-pull(1)\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\nGit 2.34.1                        02/26/2026                      GIT-FETCH(1)",
                "subsections": []
            }
        }
    }
}