{
    "content": [
        {
            "type": "text",
            "text": "# git-stripspace (man)\n\n## NAME\n\ngit-stripspace - Remove unnecessary whitespace\n\n## SYNOPSIS\n\ngit stripspace [-s | --strip-comments]\ngit stripspace [-c | --comment-lines]\n\n## DESCRIPTION\n\nRead text, such as commit messages, notes, tags and branch descriptions, from the standard\ninput and clean it in the manner used by Git.\n\n## TLDR\n\n> Read text (e.g. commit messages, notes, tags, and branch descriptions) from `stdin` and clean it into the manner used by Git.\n\n- Trim whitespace from a file:\n  `cat {{path/to/file}} | git stripspace`\n- Trim whitespace and Git comments from a file:\n  `cat {{path/to/file}} | git stripspace {{-s|--strip-comments}}`\n- Convert all lines in a file into Git comments:\n  `git < {{path/to/file}} stripspace {{-c|--comment-lines}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (2 subsections)\n- **EXAMPLES**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "git-stripspace",
        "section": "",
        "mode": "man",
        "summary": "git-stripspace - Remove unnecessary whitespace",
        "synopsis": "git stripspace [-s | --strip-comments]\ngit stripspace [-c | --comment-lines]",
        "tldr_summary": "Read text (e.g. commit messages, notes, tags, and branch descriptions) from `stdin` and clean it into the manner used by Git.",
        "tldr_examples": [
            {
                "description": "Trim whitespace from a file",
                "command": "cat {{path/to/file}} | git stripspace"
            },
            {
                "description": "Trim whitespace and Git comments from a file",
                "command": "cat {{path/to/file}} | git stripspace {{-s|--strip-comments}}"
            },
            {
                "description": "Convert all lines in a file into Git comments",
                "command": "git < {{path/to/file}} stripspace {{-c|--comment-lines}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-s",
                "long": "--strip-comments",
                "arg": null,
                "description": "Skip and remove all lines starting with comment character (default #)."
            },
            {
                "flag": "-c",
                "long": "--comment-lines",
                "arg": null,
                "description": "Prepend comment character and blank to each line. Lines will automatically be terminated with a newline. On empty lines, only the comment character will be prepended."
            }
        ],
        "examples": [
            "Given the following noisy input with $ indicating the end of a line:",
            "|A brief introduction   $",
            "|   $",
            "|$",
            "|A new paragraph$",
            "|# with a commented-out line    $",
            "|explaining lots of stuff.$",
            "|$",
            "|# An old paragraph, also commented-out. $",
            "|      $",
            "|The end.$",
            "|  $",
            "Use git stripspace with no arguments to obtain:",
            "|A brief introduction$",
            "|$",
            "|A new paragraph$",
            "|# with a commented-out line$",
            "|explaining lots of stuff.$",
            "|$",
            "|# An old paragraph, also commented-out.$",
            "|$",
            "|The end.$",
            "Use git stripspace --strip-comments to obtain:",
            "|A brief introduction$",
            "|$",
            "|A new paragraph$",
            "|explaining lots of stuff.$",
            "|$",
            "|The end.$"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-s, --strip-comments",
                        "lines": 2,
                        "flag": "-s",
                        "long": "--strip-comments"
                    },
                    {
                        "name": "-c, --comment-lines",
                        "lines": 3,
                        "flag": "-c",
                        "long": "--comment-lines"
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 38,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "git-stripspace - Remove unnecessary whitespace\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git stripspace [-s | --strip-comments]\ngit stripspace [-c | --comment-lines]\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Read text, such as commit messages, notes, tags and branch descriptions, from the standard\ninput and clean it in the manner used by Git.\n\nWith no arguments, this will:\n\n•   remove trailing whitespace from all lines\n\n•   collapse multiple consecutive empty lines into one empty line\n\n•   remove empty lines from the beginning and end of the input\n\n•   add a missing \\n to the last line if necessary.\n\nIn the case where the input consists entirely of whitespace characters, no output will be\nproduced.\n\nNOTE: This is intended for cleaning metadata, prefer the --whitespace=fix mode of git-\napply(1) for correcting whitespace of patches or files in the repository.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-s, --strip-comments",
                        "content": "Skip and remove all lines starting with comment character (default #).\n",
                        "flag": "-s",
                        "long": "--strip-comments"
                    },
                    {
                        "name": "-c, --comment-lines",
                        "content": "Prepend comment character and blank to each line. Lines will automatically be terminated\nwith a newline. On empty lines, only the comment character will be prepended.\n",
                        "flag": "-c",
                        "long": "--comment-lines"
                    }
                ]
            },
            "EXAMPLES": {
                "content": "Given the following noisy input with $ indicating the end of a line:\n\n|A brief introduction   $\n|   $\n|$\n|A new paragraph$\n|# with a commented-out line    $\n|explaining lots of stuff.$\n|$\n|# An old paragraph, also commented-out. $\n|      $\n|The end.$\n|  $\n\n\nUse git stripspace with no arguments to obtain:\n\n|A brief introduction$\n|$\n|A new paragraph$\n|# with a commented-out line$\n|explaining lots of stuff.$\n|$\n|# An old paragraph, also commented-out.$\n|$\n|The end.$\n\n\nUse git stripspace --strip-comments to obtain:\n\n|A brief introduction$\n|$\n|A new paragraph$\n|explaining lots of stuff.$\n|$\n|The end.$\n\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\n\n\nGit 2.34.1                                   02/26/2026                            GIT-STRIPSPACE(1)",
                "subsections": []
            }
        }
    }
}