{
    "content": [
        {
            "type": "text",
            "text": "# GIT-CHERRY (man)\n\n## NAME\n\ngit-cherry - Find commits yet to be applied to upstream\n\n## SYNOPSIS\n\ngit cherry [-v] [<upstream> [<head> [<limit>]]]\n\n## DESCRIPTION\n\nDetermine whether there are commits in <head>..<upstream> that are equivalent to those in the\nrange <limit>..<head>.\n\n## TLDR\n\n> Find commits that have yet to be applied upstream.\n\n- Show commits (and their messages) with equivalent commits upstream:\n  `git cherry {{-v|--verbose}}`\n- Specify a different upstream and topic branch:\n  `git cherry {{origin}} {{topic}}`\n- Limit commits to those within a given limit:\n  `git cherry {{origin}} {{topic}} {{base}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (1 subsections)\n- **EXAMPLES** (3 subsections)\n- **SEE ALSO**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "GIT-CHERRY",
        "section": "",
        "mode": "man",
        "summary": "git-cherry - Find commits yet to be applied to upstream",
        "synopsis": "git cherry [-v] [<upstream> [<head> [<limit>]]]",
        "tldr_summary": "Find commits that have yet to be applied upstream.",
        "tldr_examples": [
            {
                "description": "Show commits (and their messages) with equivalent commits upstream",
                "command": "git cherry {{-v|--verbose}}"
            },
            {
                "description": "Specify a different upstream and topic branch",
                "command": "git cherry {{origin}} {{topic}}"
            },
            {
                "description": "Limit commits to those within a given limit",
                "command": "git cherry {{origin}} {{topic}} {{base}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": "Show the commit subjects next to the SHA1s. <upstream> Upstream branch to search for equivalent commits. Defaults to the upstream branch of HEAD. <head> Working branch; defaults to HEAD. <limit> Do not report commits up to (and including) limit."
            }
        ],
        "examples": [
            "git-cherry is frequently used in patch-based workflows (see gitworkflows(7)) to determine if",
            "a series of patches has been applied by the upstream maintainer. In such a workflow you might",
            "create and send a topic branch like this:",
            "$ git checkout -b topic origin/master",
            "# work and create some commits",
            "$ git format-patch origin/master",
            "$ git send-email ... 00*",
            "Later, you can see whether your changes have been applied by saying (still on topic):",
            "$ git fetch  # update your notion of origin/master",
            "$ git cherry -v",
            "In a situation where topic consisted of three commits, and the maintainer applied two of",
            "them, the situation might look like:",
            "$ git log --graph --oneline --decorate --boundary origin/master...topic",
            "* 7654321 (origin/master) upstream tip commit",
            "[... snip some other commits ...]",
            "* cccc111 cherry-pick of C",
            "* aaaa111 cherry-pick of A",
            "[... snip a lot more that has happened ...]",
            "| * cccc000 (topic) commit C",
            "| * bbbb000 commit B",
            "| * aaaa000 commit A",
            "|/",
            "o 1234567 branch point",
            "In such cases, git-cherry shows a concise summary of what has yet to be applied:",
            "$ git cherry origin/master topic",
            "- cccc000... commit C",
            "+ bbbb000... commit B",
            "- aaaa000... commit A",
            "Here, we see that the commits A and C (marked with -) can be dropped from your topic branch",
            "when you rebase it on top of origin/master, while the commit B (marked with +) still needs to",
            "be kept so that it will be sent to be applied to origin/master.",
            "The optional <limit> is useful in cases where your topic is based on other work that is not",
            "in upstream. Expanding on the previous example, this might look like:",
            "$ git log --graph --oneline --decorate --boundary origin/master...topic",
            "* 7654321 (origin/master) upstream tip commit",
            "[... snip some other commits ...]",
            "* cccc111 cherry-pick of C",
            "* aaaa111 cherry-pick of A",
            "[... snip a lot more that has happened ...]",
            "| * cccc000 (topic) commit C",
            "| * bbbb000 commit B",
            "| * aaaa000 commit A",
            "| * 0000fff (base) unpublished stuff F",
            "[... snip ...]",
            "| * 0000aaa unpublished stuff A",
            "|/",
            "o 1234567 merge-base between upstream and topic",
            "By specifying base as the limit, you can avoid listing commits between base and topic:",
            "$ git cherry origin/master topic base",
            "- cccc000... commit C",
            "+ bbbb000... commit B",
            "- aaaa000... commit A"
        ],
        "see_also": [
            {
                "name": "git-patch-id",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-patch-id/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-v",
                        "lines": 12,
                        "flag": "-v"
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Patch workflows",
                        "lines": 16
                    },
                    {
                        "name": "Concrete example",
                        "lines": 28
                    },
                    {
                        "name": "Using a limit",
                        "lines": 27
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "git-cherry - Find commits yet to be applied to upstream\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git cherry [-v] [<upstream> [<head> [<limit>]]]\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Determine whether there are commits in <head>..<upstream> that are equivalent to those in the\nrange <limit>..<head>.\n\nThe equivalence test is based on the diff, after removing whitespace and line numbers.\ngit-cherry therefore detects when commits have been \"copied\" by means of git-cherry-pick(1),\ngit-am(1) or git-rebase(1).\n\nOutputs the SHA1 of every commit in <limit>..<head>, prefixed with - for commits that have an\nequivalent in <upstream>, and + for commits that do not.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-v",
                        "content": "Show the commit subjects next to the SHA1s.\n\n<upstream>\nUpstream branch to search for equivalent commits. Defaults to the upstream branch of\nHEAD.\n\n<head>\nWorking branch; defaults to HEAD.\n\n<limit>\nDo not report commits up to (and including) limit.\n",
                        "flag": "-v"
                    }
                ]
            },
            "EXAMPLES": {
                "content": "",
                "subsections": [
                    {
                        "name": "Patch workflows",
                        "content": "git-cherry is frequently used in patch-based workflows (see gitworkflows(7)) to determine if\na series of patches has been applied by the upstream maintainer. In such a workflow you might\ncreate and send a topic branch like this:\n\n$ git checkout -b topic origin/master\n# work and create some commits\n$ git format-patch origin/master\n$ git send-email ... 00*\n\n\nLater, you can see whether your changes have been applied by saying (still on topic):\n\n$ git fetch  # update your notion of origin/master\n$ git cherry -v\n\n"
                    },
                    {
                        "name": "Concrete example",
                        "content": "In a situation where topic consisted of three commits, and the maintainer applied two of\nthem, the situation might look like:\n\n$ git log --graph --oneline --decorate --boundary origin/master...topic\n* 7654321 (origin/master) upstream tip commit\n[... snip some other commits ...]\n* cccc111 cherry-pick of C\n* aaaa111 cherry-pick of A\n[... snip a lot more that has happened ...]\n| * cccc000 (topic) commit C\n| * bbbb000 commit B\n| * aaaa000 commit A\n|/\no 1234567 branch point\n\n\nIn such cases, git-cherry shows a concise summary of what has yet to be applied:\n\n$ git cherry origin/master topic\n- cccc000... commit C\n+ bbbb000... commit B\n- aaaa000... commit A\n\n\nHere, we see that the commits A and C (marked with -) can be dropped from your topic branch\nwhen you rebase it on top of origin/master, while the commit B (marked with +) still needs to\nbe kept so that it will be sent to be applied to origin/master.\n"
                    },
                    {
                        "name": "Using a limit",
                        "content": "The optional <limit> is useful in cases where your topic is based on other work that is not\nin upstream. Expanding on the previous example, this might look like:\n\n$ git log --graph --oneline --decorate --boundary origin/master...topic\n* 7654321 (origin/master) upstream tip commit\n[... snip some other commits ...]\n* cccc111 cherry-pick of C\n* aaaa111 cherry-pick of A\n[... snip a lot more that has happened ...]\n| * cccc000 (topic) commit C\n| * bbbb000 commit B\n| * aaaa000 commit A\n| * 0000fff (base) unpublished stuff F\n[... snip ...]\n| * 0000aaa unpublished stuff A\n|/\no 1234567 merge-base between upstream and topic\n\n\nBy specifying base as the limit, you can avoid listing commits between base and topic:\n\n$ git cherry origin/master topic base\n- cccc000... commit C\n+ bbbb000... commit B\n- aaaa000... commit A\n\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "git-patch-id(1)\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\n\n\nGit 2.34.1                                   02/26/2026                                GIT-CHERRY(1)",
                "subsections": []
            }
        }
    }
}