{
    "content": [
        {
            "type": "text",
            "text": "# git-commit (man)\n\n## NAME\n\ngit-commit - Record changes to the repository\n\n## SYNOPSIS\n\ngit commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n[--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)]\n[-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n[--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n[--date=<date>] [--cleanup=<mode>] [--[no-]status]\n[-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n[(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n[--] [<pathspec>...]\n\n## DESCRIPTION\n\nCreate a new commit containing the current contents of the index and the given log message\ndescribing the changes. The new commit is a direct child of HEAD, usually the tip of the\ncurrent branch, and the branch is updated to point to it (unless no branch is associated with\nthe working tree, in which case HEAD is \"detached\" as described in git-checkout(1)).\n\n## TLDR\n\n> Commit files to the repository.\n\n- Open an editor to write a message and commit staged files to the repository:\n  `git commit`\n- Commit staged files to the repository with the specified message:\n  `git commit {{-m|--message}} \"{{message}}\"`\n- Commit staged files with a message read from a file:\n  `git commit {{-F|--file}} {{path/to/commit_message_file}}`\n- Auto stage all modified and deleted files and commit:\n  `git commit {{-a|--all}} {{-m|--message}} \"{{message}}\"`\n- Commit staged files and sign them with the specified GPG key (or the one defined in the configuration file if no `key_id` is specified):\n  `git commit {{-S|--gpg-sign}} {{key_id}} {{-m|--message}} \"{{message}}\"`\n- Update the last commit by adding the currently staged changes, changing the commit's hash and open an editor to change the message:\n  `git commit --amend`\n- Commit only specific (already staged) files:\n  `git commit {{path/to/file1 path/to/file2 ...}}`\n- Create a commit with the specified message and description:\n  `git commit {{-m|--message}} \"{{message}}\" {{-m|--message}} \"{{description}}\"`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (23 subsections)\n- **EXAMPLES**\n- **COMMIT INFORMATION**\n- **DATE FORMATS**\n- **DISCUSSION**\n- **ENVIRONMENT AND CONFIGURATION VARIABLES**\n- **HOOKS**\n- **FILES**\n- **SEE ALSO**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "git-commit",
        "section": "",
        "mode": "man",
        "summary": "git-commit - Record changes to the repository",
        "synopsis": "git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n[--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)]\n[-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n[--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n[--date=<date>] [--cleanup=<mode>] [--[no-]status]\n[-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n[(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n[--] [<pathspec>...]",
        "tldr_summary": "Commit files to the repository.",
        "tldr_examples": [
            {
                "description": "Open an editor to write a message and commit staged files to the repository",
                "command": "git commit"
            },
            {
                "description": "Commit staged files to the repository with the specified message",
                "command": "git commit {{-m|--message}} \"{{message}}\""
            },
            {
                "description": "Commit staged files with a message read from a file",
                "command": "git commit {{-F|--file}} {{path/to/commit_message_file}}"
            },
            {
                "description": "Auto stage all modified and deleted files and commit",
                "command": "git commit {{-a|--all}} {{-m|--message}} \"{{message}}\""
            },
            {
                "description": "Commit staged files and sign them with the specified GPG key (or the one defined in the configuration file if no `key_id` is specified)",
                "command": "git commit {{-S|--gpg-sign}} {{key_id}} {{-m|--message}} \"{{message}}\""
            },
            {
                "description": "Update the last commit by adding the currently staged changes, changing the commit's hash and open an editor to change the message",
                "command": "git commit --amend"
            },
            {
                "description": "Commit only specific (already staged) files",
                "command": "git commit {{path/to/file1 path/to/file2 ...}}"
            },
            {
                "description": "Create a commit with the specified message and description",
                "command": "git commit {{-m|--message}} \"{{message}}\" {{-m|--message}} \"{{description}}\""
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-a",
                "long": "--all",
                "arg": null,
                "description": "Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected."
            },
            {
                "flag": "-p",
                "long": "--patch",
                "arg": null,
                "description": "Use the interactive patch selection interface to choose which changes to commit. See git- add(1) for details. -C <commit>, --reuse-message=<commit> Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit. -c <commit>, --reedit-message=<commit> Like -C, but with -c the editor is invoked, so that the user can further edit the commit message. --fixup=[(amend|reword):]<commit> Create a new commit which \"fixes up\" <commit> when applied with git rebase --autosquash. Plain --fixup=<commit> creates a \"fixup!\" commit which changes the content of <commit> but leaves its log message untouched. --fixup=amend:<commit> is similar but creates an \"amend!\" commit which also replaces the log message of <commit> with the log message of the \"amend!\" commit. --fixup=reword:<commit> creates an \"amend!\" commit which replaces the log message of <commit> with its own log message but makes no changes to the content of <commit>. The commit created by plain --fixup=<commit> has a subject composed of \"fixup!\" followed by the subject line from <commit>, and is recognized specially by git rebase --autosquash. The -m option may be used to supplement the log message of the created commit, but the additional commentary will be thrown away once the \"fixup!\" commit is squashed into <commit> by git rebase --autosquash. The commit created by --fixup=amend:<commit> is similar but its subject is instead prefixed with \"amend!\". The log message of <commit> is copied into the log message of the \"amend!\" commit and opened in an editor so it can be refined. When git rebase --autosquash squashes the \"amend!\" commit into <commit>, the log message of <commit> is replaced by the refined log message from the \"amend!\" commit. It is an error for the \"amend!\" commit’s log message to be empty unless --allow-empty-message is specified. --fixup=reword:<commit> is shorthand for --fixup=amend:<commit> --only. It creates an \"amend!\" commit with only a log message (ignoring any changes staged in the index). When squashed by git rebase --autosquash, it replaces the log message of <commit> without making any other changes. Neither \"fixup!\" nor \"amend!\" commits change authorship of <commit> when applied by git rebase --autosquash. See git-rebase(1) for details. --squash=<commit> Construct a commit message for use with rebase --autosquash. The commit message subject line is taken from the specified commit with a prefix of \"squash! \". Can be used with additional commit message options (-m/-c/-C/-F). See git-rebase(1) for details."
            },
            {
                "flag": "",
                "long": "--reset-author",
                "arg": null,
                "description": "When used with -C/-c/--amend options, or when committing after a conflicting cherry-pick, declare that the authorship of the resulting commit now belongs to the committer. This also renews the author timestamp."
            },
            {
                "flag": "",
                "long": "--short",
                "arg": null,
                "description": "When doing a dry-run, give the output in the short-format. See git-status(1) for details. Implies --dry-run."
            },
            {
                "flag": "",
                "long": "--branch",
                "arg": null,
                "description": "Show the branch and tracking info even in short-format."
            },
            {
                "flag": "",
                "long": "--porcelain",
                "arg": null,
                "description": "When doing a dry-run, give the output in a porcelain-ready format. See git-status(1) for details. Implies --dry-run."
            },
            {
                "flag": "",
                "long": "--long",
                "arg": null,
                "description": "When doing a dry-run, give the output in the long-format. Implies --dry-run."
            },
            {
                "flag": "-z",
                "long": "--null",
                "arg": null,
                "description": "When showing short or porcelain status output, print the filename verbatim and terminate the entries with NUL, instead of LF. If no format is given, implies the --porcelain output format. Without the -z option, filenames with \"unusual\" characters are quoted as explained for the configuration variable core.quotePath (see git-config(1)). -F <file>, --file=<file> Take the commit message from the given file. Use - to read the message from the standard input. --author=<author> Override the commit author. Specify an explicit author using the standard A U Thor <author@example.com> format. Otherwise <author> is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=<author>); the commit author is then copied from the first such commit found. --date=<date> Override the author date used in the commit. -m <msg>, --message=<msg> Use the given <msg> as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs. The -m option is mutually exclusive with -c, -C, and -F. -t <file>, --template=<file> When editing the commit message, start the editor with the contents in the given file. The commit.template configuration variable is often used to give this option implicitly to the command. This mechanism can be used by projects that want to guide participants with some hints on what to write in the message in what order. If the user exits the editor without editing the message, the commit is aborted. This has no effect when a message is given by other means, e.g. with the -m or -F options."
            },
            {
                "flag": "-s",
                "long": "--no-signoff",
                "arg": null,
                "description": "Add a Signed-off-by trailer by the committer at the end of the commit log message. The meaning of a signoff depends on the project to which you’re committing. For example, it may certify that the committer has the rights to submit the work under the project’s license or agrees to some contributor representation, such as a Developer Certificate of Origin. (See http://developercertificate.org for the one used by the Linux kernel and Git projects.) Consult the documentation or leadership of the project to which you’re contributing to understand how the signoffs are used in that project. The --no-signoff option can be used to countermand an earlier --signoff option on the command line. --trailer <token>[(=|:)<value>] Specify a (<token>, <value>) pair that should be applied as a trailer. (e.g. git commit --trailer \"Signed-off-by:C O Mitter \\ <committer@example.com>\" --trailer \"Helped-by:C O Mitter \\ <committer@example.com>\" will add the \"Signed-off-by\" trailer and the \"Helped-by\" trailer to the commit message.) The trailer.* configuration variables (git- interpret-trailers(1)) can be used to define if a duplicated trailer is omitted, where in the run of trailers each trailer would appear, and other details. -n, --[no-]verify By default, the pre-commit and commit-msg hooks are run. When any of --no-verify or -n is given, these are bypassed. See also githooks(5)."
            },
            {
                "flag": "",
                "long": "--allow-empty",
                "arg": null,
                "description": "Usually recording a commit that has the exact same tree as its sole parent commit is a mistake, and the command prevents you from making such a commit. This option bypasses the safety, and is primarily for use by foreign SCM interface scripts."
            },
            {
                "flag": "",
                "long": "--allow-empty-message",
                "arg": null,
                "description": "Like --allow-empty this command is primarily for use by foreign SCM interface scripts. It allows you to create a commit with an empty commit message without using plumbing commands like git-commit-tree(1). --cleanup=<mode> This option determines how the supplied commit message should be cleaned up before committing. The <mode> can be strip, whitespace, verbatim, scissors or default. strip Strip leading and trailing empty lines, trailing whitespace, commentary and collapse consecutive empty lines. whitespace Same as strip except #commentary is not removed. verbatim Do not change the message at all. scissors Same as whitespace except that everything from (and including) the line found below is truncated, if the message is to be edited. \"#\" can be customized with core.commentChar. # ------------------------ >8 ------------------------ default Same as strip if the message is to be edited. Otherwise whitespace. The default can be changed by the commit.cleanup configuration variable (see git- config(1))."
            },
            {
                "flag": "-e",
                "long": "--edit",
                "arg": null,
                "description": "The message taken from file with -F, command line with -m, and from commit object with -C are usually used as the commit log message unmodified. This option lets you further edit the message taken from these sources."
            },
            {
                "flag": "",
                "long": "--no-edit",
                "arg": null,
                "description": "Use the selected commit message without launching an editor. For example, git commit --amend --no-edit amends a commit without changing its commit message."
            },
            {
                "flag": "",
                "long": "--amend",
                "arg": null,
                "description": "Replace the tip of the current branch by creating a new commit. The recorded tree is prepared as usual (including the effect of the -i and -o options and explicit pathspec), and the message from the original commit is used as the starting point, instead of an empty message, when no other message is specified from the command line via options such as -m, -F, -c, etc. The new commit has the same parents and author as the current one (the --reset-author option can countermand this). It is a rough equivalent for: $ git reset --soft HEAD^ $ ... do something else to come up with the right tree ... $ git commit -c ORIGHEAD but can be used to amend a merge commit. You should understand the implications of rewriting history if you amend a commit that has already been published. (See the \"RECOVERING FROM UPSTREAM REBASE\" section in git- rebase(1).)"
            },
            {
                "flag": "",
                "long": "--no-post-rewrite",
                "arg": null,
                "description": "Bypass the post-rewrite hook."
            },
            {
                "flag": "-i",
                "long": "--include",
                "arg": null,
                "description": "Before making a commit out of staged contents so far, stage the contents of paths given on the command line as well. This is usually not what you want unless you are concluding a conflicted merge."
            },
            {
                "flag": "-o",
                "long": "--only",
                "arg": null,
                "description": "Make a commit by taking the updated working tree contents of the paths specified on the command line, disregarding any contents that have been staged for other paths. This is the default mode of operation of git commit if any paths are given on the command line, in which case this option can be omitted. If this option is specified together with --amend, then no paths need to be specified, which can be used to amend the last commit without committing changes that have already been staged. If used together with --allow-empty paths are also not required, and an empty commit will be created. --pathspec-from-file=<file> Pathspec is passed in <file> instead of commandline args. If <file> is exactly - then standard input is used. Pathspec elements are separated by LF or CR/LF. Pathspec elements can be quoted as explained for the configuration variable core.quotePath (see git- config(1)). See also --pathspec-file-nul and global --literal-pathspecs."
            },
            {
                "flag": "",
                "long": "--pathspec-file-nul",
                "arg": null,
                "description": "Only meaningful with --pathspec-from-file. Pathspec elements are separated with NUL character and all other characters are taken literally (including newlines and quotes). -u[<mode>], --untracked-files[=<mode>] Show untracked files. The mode parameter is optional (defaults to all), and is used to specify the handling of untracked files; when -u is not used, the default is normal, i.e. show untracked files and directories. The possible options are: • no - Show no untracked files • normal - Shows untracked files and directories • all - Also shows individual files in untracked directories. The default can be changed using the status.showUntrackedFiles configuration variable documented in git-config(1)."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template to help the user describe the commit by reminding what changes the commit has. Note that this diff output doesn’t have its lines prefixed with #. This diff will not be a part of the commit message. See the commit.verbose configuration variable in git-config(1). If specified twice, show in addition the unified diff between what would be committed and the worktree files, i.e. the unstaged changes to tracked files."
            },
            {
                "flag": "-q",
                "long": "--quiet",
                "arg": null,
                "description": "Suppress commit summary message."
            },
            {
                "flag": "",
                "long": "--dry-run",
                "arg": null,
                "description": "Do not create a commit, but show a list of paths that are to be committed, paths with local changes that will be left uncommitted and paths that are untracked."
            },
            {
                "flag": "",
                "long": "--status",
                "arg": null,
                "description": "Include the output of git-status(1) in the commit message template when using an editor to prepare the commit message. Defaults to on, but can be used to override configuration variable commit.status."
            },
            {
                "flag": "",
                "long": "--no-status",
                "arg": null,
                "description": "Do not include the output of git-status(1) in the commit message template when using an editor to prepare the default commit message. -S[<keyid>], --gpg-sign[=<keyid>], --no-gpg-sign GPG-sign commits. The keyid argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space. --no-gpg-sign is useful to countermand both commit.gpgSign configuration variable, and earlier --gpg-sign. -- Do not interpret any more arguments as options. <pathspec>... When pathspec is given on the command line, commit the contents of the files that match the pathspec without recording the changes already added to the index. The contents of these files are also staged for the next commit on top of what have been staged before. For more details, see the pathspec entry in gitglossary(7)."
            }
        ],
        "examples": [
            "When recording your own work, the contents of modified files in your working tree are",
            "temporarily stored to a staging area called the \"index\" with git add. A file can be reverted",
            "back, only in the index but not in the working tree, to that of the last commit with git",
            "restore --staged <file>, which effectively reverts git add and prevents the changes to this",
            "file from participating in the next commit. After building the state to be committed",
            "incrementally with these commands, git commit (without any pathname parameter) is used to",
            "record what has been staged so far. This is the most basic form of the command. An example:",
            "$ edit hello.c",
            "$ git rm goodbye.c",
            "$ git add hello.c",
            "$ git commit",
            "Instead of staging files after each individual change, you can tell git commit to notice the",
            "changes to the files whose contents are tracked in your working tree and do corresponding git",
            "add and git rm for you. That is, this example does the same as the earlier example if there",
            "is no other change in your working tree:",
            "$ edit hello.c",
            "$ rm goodbye.c",
            "$ git commit -a",
            "The command git commit -a first looks at your working tree, notices that you have modified",
            "hello.c and removed goodbye.c, and performs necessary git add and git rm for you.",
            "After staging changes to many files, you can alter the order the changes are recorded in, by",
            "giving pathnames to git commit. When pathnames are given, the command makes a commit that",
            "only records the changes made to the named paths:",
            "$ edit hello.c hello.h",
            "$ git add hello.c hello.h",
            "$ edit Makefile",
            "$ git commit Makefile",
            "This makes a commit that records the modification to Makefile. The changes staged for hello.c",
            "and hello.h are not included in the resulting commit. However, their changes are not lost —",
            "they are still staged and merely held back. After the above sequence, if you do:",
            "$ git commit",
            "this second commit would record the changes to hello.c and hello.h as expected.",
            "After a merge (initiated by git merge or git pull) stops because of conflicts, cleanly merged",
            "paths are already staged to be committed for you, and paths that conflicted are left in",
            "unmerged state. You would have to first check which paths are conflicting with git status and",
            "after fixing them manually in your working tree, you would stage the result as usual with git",
            "add:",
            "$ git status | grep unmerged",
            "unmerged: hello.c",
            "$ edit hello.c",
            "$ git add hello.c",
            "After resolving conflicts and staging the result, git ls-files -u would stop mentioning the",
            "conflicted path. When you are done, run git commit to finally record the merge:",
            "$ git commit",
            "As with the case to record your own changes, you can use -a option to save typing. One",
            "difference is that during a merge resolution, you cannot use git commit with pathnames to",
            "alter the order the changes are committed, because the merge should be recorded as a single",
            "commit. In fact, the command refuses to run when given pathnames (but see -i option)."
        ],
        "see_also": [
            {
                "name": "git-add",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-add/1/json"
            },
            {
                "name": "git-rm",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-rm/1/json"
            },
            {
                "name": "git-mv",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-mv/1/json"
            },
            {
                "name": "git-merge",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-merge/1/json"
            },
            {
                "name": "git-commit-tree",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/git-commit-tree/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 33,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-a, --all",
                        "lines": 3,
                        "flag": "-a",
                        "long": "--all"
                    },
                    {
                        "name": "-p, --patch",
                        "lines": 46,
                        "flag": "-p",
                        "long": "--patch"
                    },
                    {
                        "name": "--reset-author",
                        "lines": 4,
                        "long": "--reset-author"
                    },
                    {
                        "name": "--short",
                        "lines": 3,
                        "long": "--short"
                    },
                    {
                        "name": "--branch",
                        "lines": 2,
                        "long": "--branch"
                    },
                    {
                        "name": "--porcelain",
                        "lines": 3,
                        "long": "--porcelain"
                    },
                    {
                        "name": "--long",
                        "lines": 2,
                        "long": "--long"
                    },
                    {
                        "name": "-z, --null",
                        "lines": 32,
                        "flag": "-z",
                        "long": "--null"
                    },
                    {
                        "name": "-s, --signoff, --no-signoff",
                        "lines": 23,
                        "flag": "-s",
                        "long": "--no-signoff"
                    },
                    {
                        "name": "--allow-empty",
                        "lines": 4,
                        "long": "--allow-empty"
                    },
                    {
                        "name": "--allow-empty-message",
                        "lines": 31,
                        "long": "--allow-empty-message"
                    },
                    {
                        "name": "-e, --edit",
                        "lines": 4,
                        "flag": "-e",
                        "long": "--edit"
                    },
                    {
                        "name": "--no-edit",
                        "lines": 3,
                        "long": "--no-edit"
                    },
                    {
                        "name": "--amend",
                        "lines": 19,
                        "long": "--amend"
                    },
                    {
                        "name": "--no-post-rewrite",
                        "lines": 2,
                        "long": "--no-post-rewrite"
                    },
                    {
                        "name": "-i, --include",
                        "lines": 4,
                        "flag": "-i",
                        "long": "--include"
                    },
                    {
                        "name": "-o, --only",
                        "lines": 14,
                        "flag": "-o",
                        "long": "--only"
                    },
                    {
                        "name": "--pathspec-file-nul",
                        "lines": 21,
                        "long": "--pathspec-file-nul"
                    },
                    {
                        "name": "-v, --verbose",
                        "lines": 9,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-q, --quiet",
                        "lines": 2,
                        "flag": "-q",
                        "long": "--quiet"
                    },
                    {
                        "name": "--dry-run",
                        "lines": 3,
                        "long": "--dry-run"
                    },
                    {
                        "name": "--status",
                        "lines": 4,
                        "long": "--status"
                    },
                    {
                        "name": "--no-status",
                        "lines": 18,
                        "long": "--no-status"
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 69,
                "subsections": []
            },
            {
                "name": "COMMIT INFORMATION",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "DATE FORMATS",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "DISCUSSION",
                "lines": 60,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT AND CONFIGURATION VARIABLES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "HOOKS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "git-commit - Record changes to the repository\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]\n[--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)]\n[-F <file> | -m <msg>] [--reset-author] [--allow-empty]\n[--allow-empty-message] [--no-verify] [-e] [--author=<author>]\n[--date=<date>] [--cleanup=<mode>] [--[no-]status]\n[-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n[(--trailer <token>[(=|:)<value>])...] [-S[<keyid>]]\n[--] [<pathspec>...]\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Create a new commit containing the current contents of the index and the given log message\ndescribing the changes. The new commit is a direct child of HEAD, usually the tip of the\ncurrent branch, and the branch is updated to point to it (unless no branch is associated with\nthe working tree, in which case HEAD is \"detached\" as described in git-checkout(1)).\n\nThe content to be committed can be specified in several ways:\n\n1. by using git-add(1) to incrementally \"add\" changes to the index before using the commit\ncommand (Note: even modified files must be \"added\");\n\n2. by using git-rm(1) to remove files from the working tree and the index, again before\nusing the commit command;\n\n3. by listing files as arguments to the commit command (without --interactive or --patch\nswitch), in which case the commit will ignore changes staged in the index, and instead\nrecord the current content of the listed files (which must already be known to Git);\n\n4. by using the -a switch with the commit command to automatically \"add\" changes from all\nknown files (i.e. all files that are already listed in the index) and to automatically\n\"rm\" files in the index that have been removed from the working tree, and then perform\nthe actual commit;\n\n5. by using the --interactive or --patch switches with the commit command to decide one by\none which files or hunks should be part of the commit in addition to contents in the\nindex, before finalizing the operation. See the “Interactive Mode” section of git-add(1)\nto learn how to operate these modes.\n\nThe --dry-run option can be used to obtain a summary of what is included by any of the above\nfor the next commit by giving the same set of parameters (options and paths).\n\nIf you make a commit and then find a mistake immediately after that, you can recover from it\nwith git reset.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-a, --all",
                        "content": "Tell the command to automatically stage files that have been modified and deleted, but\nnew files you have not told Git about are not affected.\n",
                        "flag": "-a",
                        "long": "--all"
                    },
                    {
                        "name": "-p, --patch",
                        "content": "Use the interactive patch selection interface to choose which changes to commit. See git-\nadd(1) for details.\n\n-C <commit>, --reuse-message=<commit>\nTake an existing commit object, and reuse the log message and the authorship information\n(including the timestamp) when creating the commit.\n\n-c <commit>, --reedit-message=<commit>\nLike -C, but with -c the editor is invoked, so that the user can further edit the commit\nmessage.\n\n--fixup=[(amend|reword):]<commit>\nCreate a new commit which \"fixes up\" <commit> when applied with git rebase --autosquash.\nPlain --fixup=<commit> creates a \"fixup!\" commit which changes the content of <commit>\nbut leaves its log message untouched.  --fixup=amend:<commit> is similar but creates an\n\"amend!\" commit which also replaces the log message of <commit> with the log message of\nthe \"amend!\" commit.  --fixup=reword:<commit> creates an \"amend!\" commit which replaces\nthe log message of <commit> with its own log message but makes no changes to the content\nof <commit>.\n\nThe commit created by plain --fixup=<commit> has a subject composed of \"fixup!\" followed\nby the subject line from <commit>, and is recognized specially by git rebase\n--autosquash. The -m option may be used to supplement the log message of the created\ncommit, but the additional commentary will be thrown away once the \"fixup!\" commit is\nsquashed into <commit> by git rebase --autosquash.\n\nThe commit created by --fixup=amend:<commit> is similar but its subject is instead\nprefixed with \"amend!\". The log message of <commit> is copied into the log message of the\n\"amend!\" commit and opened in an editor so it can be refined. When git rebase\n--autosquash squashes the \"amend!\" commit into <commit>, the log message of <commit> is\nreplaced by the refined log message from the \"amend!\" commit. It is an error for the\n\"amend!\" commit’s log message to be empty unless --allow-empty-message is specified.\n\n--fixup=reword:<commit> is shorthand for --fixup=amend:<commit> --only. It creates an\n\"amend!\" commit with only a log message (ignoring any changes staged in the index). When\nsquashed by git rebase --autosquash, it replaces the log message of <commit> without\nmaking any other changes.\n\nNeither \"fixup!\" nor \"amend!\" commits change authorship of <commit> when applied by git\nrebase --autosquash. See git-rebase(1) for details.\n\n--squash=<commit>\nConstruct a commit message for use with rebase --autosquash. The commit message subject\nline is taken from the specified commit with a prefix of \"squash! \". Can be used with\nadditional commit message options (-m/-c/-C/-F). See git-rebase(1) for details.\n",
                        "flag": "-p",
                        "long": "--patch"
                    },
                    {
                        "name": "--reset-author",
                        "content": "When used with -C/-c/--amend options, or when committing after a conflicting cherry-pick,\ndeclare that the authorship of the resulting commit now belongs to the committer. This\nalso renews the author timestamp.\n",
                        "long": "--reset-author"
                    },
                    {
                        "name": "--short",
                        "content": "When doing a dry-run, give the output in the short-format. See git-status(1) for details.\nImplies --dry-run.\n",
                        "long": "--short"
                    },
                    {
                        "name": "--branch",
                        "content": "Show the branch and tracking info even in short-format.\n",
                        "long": "--branch"
                    },
                    {
                        "name": "--porcelain",
                        "content": "When doing a dry-run, give the output in a porcelain-ready format. See git-status(1) for\ndetails. Implies --dry-run.\n",
                        "long": "--porcelain"
                    },
                    {
                        "name": "--long",
                        "content": "When doing a dry-run, give the output in the long-format. Implies --dry-run.\n",
                        "long": "--long"
                    },
                    {
                        "name": "-z, --null",
                        "content": "When showing short or porcelain status output, print the filename verbatim and terminate\nthe entries with NUL, instead of LF. If no format is given, implies the --porcelain\noutput format. Without the -z option, filenames with \"unusual\" characters are quoted as\nexplained for the configuration variable core.quotePath (see git-config(1)).\n\n-F <file>, --file=<file>\nTake the commit message from the given file. Use - to read the message from the standard\ninput.\n\n--author=<author>\nOverride the commit author. Specify an explicit author using the standard A U Thor\n<author@example.com> format. Otherwise <author> is assumed to be a pattern and is used to\nsearch for an existing commit by that author (i.e. rev-list --all -i --author=<author>);\nthe commit author is then copied from the first such commit found.\n\n--date=<date>\nOverride the author date used in the commit.\n\n-m <msg>, --message=<msg>\nUse the given <msg> as the commit message. If multiple -m options are given, their values\nare concatenated as separate paragraphs.\n\nThe -m option is mutually exclusive with -c, -C, and -F.\n\n-t <file>, --template=<file>\nWhen editing the commit message, start the editor with the contents in the given file.\nThe commit.template configuration variable is often used to give this option implicitly\nto the command. This mechanism can be used by projects that want to guide participants\nwith some hints on what to write in the message in what order. If the user exits the\neditor without editing the message, the commit is aborted. This has no effect when a\nmessage is given by other means, e.g. with the -m or -F options.\n",
                        "flag": "-z",
                        "long": "--null"
                    },
                    {
                        "name": "-s, --signoff, --no-signoff",
                        "content": "Add a Signed-off-by trailer by the committer at the end of the commit log message. The\nmeaning of a signoff depends on the project to which you’re committing. For example, it\nmay certify that the committer has the rights to submit the work under the project’s\nlicense or agrees to some contributor representation, such as a Developer Certificate of\nOrigin. (See http://developercertificate.org for the one used by the Linux kernel and Git\nprojects.) Consult the documentation or leadership of the project to which you’re\ncontributing to understand how the signoffs are used in that project.\n\nThe --no-signoff option can be used to countermand an earlier --signoff option on the\ncommand line.\n\n--trailer <token>[(=|:)<value>]\nSpecify a (<token>, <value>) pair that should be applied as a trailer. (e.g.  git commit\n--trailer \"Signed-off-by:C O Mitter \\ <committer@example.com>\" --trailer \"Helped-by:C O\nMitter \\ <committer@example.com>\" will add the \"Signed-off-by\" trailer and the\n\"Helped-by\" trailer to the commit message.) The trailer.*  configuration variables (git-\ninterpret-trailers(1)) can be used to define if a duplicated trailer is omitted, where in\nthe run of trailers each trailer would appear, and other details.\n\n-n, --[no-]verify\nBy default, the pre-commit and commit-msg hooks are run. When any of --no-verify or -n is\ngiven, these are bypassed. See also githooks(5).\n",
                        "flag": "-s",
                        "long": "--no-signoff"
                    },
                    {
                        "name": "--allow-empty",
                        "content": "Usually recording a commit that has the exact same tree as its sole parent commit is a\nmistake, and the command prevents you from making such a commit. This option bypasses the\nsafety, and is primarily for use by foreign SCM interface scripts.\n",
                        "long": "--allow-empty"
                    },
                    {
                        "name": "--allow-empty-message",
                        "content": "Like --allow-empty this command is primarily for use by foreign SCM interface scripts. It\nallows you to create a commit with an empty commit message without using plumbing\ncommands like git-commit-tree(1).\n\n--cleanup=<mode>\nThis option determines how the supplied commit message should be cleaned up before\ncommitting. The <mode> can be strip, whitespace, verbatim, scissors or default.\n\nstrip\nStrip leading and trailing empty lines, trailing whitespace, commentary and collapse\nconsecutive empty lines.\n\nwhitespace\nSame as strip except #commentary is not removed.\n\nverbatim\nDo not change the message at all.\n\nscissors\nSame as whitespace except that everything from (and including) the line found below\nis truncated, if the message is to be edited. \"#\" can be customized with\ncore.commentChar.\n\n# ------------------------ >8 ------------------------\n\ndefault\nSame as strip if the message is to be edited. Otherwise whitespace.\n\nThe default can be changed by the commit.cleanup configuration variable (see git-\nconfig(1)).\n",
                        "long": "--allow-empty-message"
                    },
                    {
                        "name": "-e, --edit",
                        "content": "The message taken from file with -F, command line with -m, and from commit object with -C\nare usually used as the commit log message unmodified. This option lets you further edit\nthe message taken from these sources.\n",
                        "flag": "-e",
                        "long": "--edit"
                    },
                    {
                        "name": "--no-edit",
                        "content": "Use the selected commit message without launching an editor. For example, git commit\n--amend --no-edit amends a commit without changing its commit message.\n",
                        "long": "--no-edit"
                    },
                    {
                        "name": "--amend",
                        "content": "Replace the tip of the current branch by creating a new commit. The recorded tree is\nprepared as usual (including the effect of the -i and -o options and explicit pathspec),\nand the message from the original commit is used as the starting point, instead of an\nempty message, when no other message is specified from the command line via options such\nas -m, -F, -c, etc. The new commit has the same parents and author as the current one\n(the --reset-author option can countermand this).\n\nIt is a rough equivalent for:\n\n$ git reset --soft HEAD^\n$ ... do something else to come up with the right tree ...\n$ git commit -c ORIGHEAD\n\nbut can be used to amend a merge commit.\n\nYou should understand the implications of rewriting history if you amend a commit that\nhas already been published. (See the \"RECOVERING FROM UPSTREAM REBASE\" section in git-\nrebase(1).)\n",
                        "long": "--amend"
                    },
                    {
                        "name": "--no-post-rewrite",
                        "content": "Bypass the post-rewrite hook.\n",
                        "long": "--no-post-rewrite"
                    },
                    {
                        "name": "-i, --include",
                        "content": "Before making a commit out of staged contents so far, stage the contents of paths given\non the command line as well. This is usually not what you want unless you are concluding\na conflicted merge.\n",
                        "flag": "-i",
                        "long": "--include"
                    },
                    {
                        "name": "-o, --only",
                        "content": "Make a commit by taking the updated working tree contents of the paths specified on the\ncommand line, disregarding any contents that have been staged for other paths. This is\nthe default mode of operation of git commit if any paths are given on the command line,\nin which case this option can be omitted. If this option is specified together with\n--amend, then no paths need to be specified, which can be used to amend the last commit\nwithout committing changes that have already been staged. If used together with\n--allow-empty paths are also not required, and an empty commit will be created.\n\n--pathspec-from-file=<file>\nPathspec is passed in <file> instead of commandline args. If <file> is exactly - then\nstandard input is used. Pathspec elements are separated by LF or CR/LF. Pathspec elements\ncan be quoted as explained for the configuration variable core.quotePath (see git-\nconfig(1)). See also --pathspec-file-nul and global --literal-pathspecs.\n",
                        "flag": "-o",
                        "long": "--only"
                    },
                    {
                        "name": "--pathspec-file-nul",
                        "content": "Only meaningful with --pathspec-from-file. Pathspec elements are separated with NUL\ncharacter and all other characters are taken literally (including newlines and quotes).\n\n-u[<mode>], --untracked-files[=<mode>]\nShow untracked files.\n\nThe mode parameter is optional (defaults to all), and is used to specify the handling of\nuntracked files; when -u is not used, the default is normal, i.e. show untracked files\nand directories.\n\nThe possible options are:\n\n•   no - Show no untracked files\n\n•   normal - Shows untracked files and directories\n\n•   all - Also shows individual files in untracked directories.\n\nThe default can be changed using the status.showUntrackedFiles configuration variable\ndocumented in git-config(1).\n",
                        "long": "--pathspec-file-nul"
                    },
                    {
                        "name": "-v, --verbose",
                        "content": "Show unified diff between the HEAD commit and what would be committed at the bottom of\nthe commit message template to help the user describe the commit by reminding what\nchanges the commit has. Note that this diff output doesn’t have its lines prefixed with\n#. This diff will not be a part of the commit message. See the commit.verbose\nconfiguration variable in git-config(1).\n\nIf specified twice, show in addition the unified diff between what would be committed and\nthe worktree files, i.e. the unstaged changes to tracked files.\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-q, --quiet",
                        "content": "Suppress commit summary message.\n",
                        "flag": "-q",
                        "long": "--quiet"
                    },
                    {
                        "name": "--dry-run",
                        "content": "Do not create a commit, but show a list of paths that are to be committed, paths with\nlocal changes that will be left uncommitted and paths that are untracked.\n",
                        "long": "--dry-run"
                    },
                    {
                        "name": "--status",
                        "content": "Include the output of git-status(1) in the commit message template when using an editor\nto prepare the commit message. Defaults to on, but can be used to override configuration\nvariable commit.status.\n",
                        "long": "--status"
                    },
                    {
                        "name": "--no-status",
                        "content": "Do not include the output of git-status(1) in the commit message template when using an\neditor to prepare the default commit message.\n\n-S[<keyid>], --gpg-sign[=<keyid>], --no-gpg-sign\nGPG-sign commits. The keyid argument is optional and defaults to the committer identity;\nif specified, it must be stuck to the option without a space.  --no-gpg-sign is useful to\ncountermand both commit.gpgSign configuration variable, and earlier --gpg-sign.\n\n--\nDo not interpret any more arguments as options.\n\n<pathspec>...\nWhen pathspec is given on the command line, commit the contents of the files that match\nthe pathspec without recording the changes already added to the index. The contents of\nthese files are also staged for the next commit on top of what have been staged before.\n\nFor more details, see the pathspec entry in gitglossary(7).\n",
                        "long": "--no-status"
                    }
                ]
            },
            "EXAMPLES": {
                "content": "When recording your own work, the contents of modified files in your working tree are\ntemporarily stored to a staging area called the \"index\" with git add. A file can be reverted\nback, only in the index but not in the working tree, to that of the last commit with git\nrestore --staged <file>, which effectively reverts git add and prevents the changes to this\nfile from participating in the next commit. After building the state to be committed\nincrementally with these commands, git commit (without any pathname parameter) is used to\nrecord what has been staged so far. This is the most basic form of the command. An example:\n\n$ edit hello.c\n$ git rm goodbye.c\n$ git add hello.c\n$ git commit\n\n\nInstead of staging files after each individual change, you can tell git commit to notice the\nchanges to the files whose contents are tracked in your working tree and do corresponding git\nadd and git rm for you. That is, this example does the same as the earlier example if there\nis no other change in your working tree:\n\n$ edit hello.c\n$ rm goodbye.c\n$ git commit -a\n\n\nThe command git commit -a first looks at your working tree, notices that you have modified\nhello.c and removed goodbye.c, and performs necessary git add and git rm for you.\n\nAfter staging changes to many files, you can alter the order the changes are recorded in, by\ngiving pathnames to git commit. When pathnames are given, the command makes a commit that\nonly records the changes made to the named paths:\n\n$ edit hello.c hello.h\n$ git add hello.c hello.h\n$ edit Makefile\n$ git commit Makefile\n\n\nThis makes a commit that records the modification to Makefile. The changes staged for hello.c\nand hello.h are not included in the resulting commit. However, their changes are not lost —\nthey are still staged and merely held back. After the above sequence, if you do:\n\n$ git commit\n\n\nthis second commit would record the changes to hello.c and hello.h as expected.\n\nAfter a merge (initiated by git merge or git pull) stops because of conflicts, cleanly merged\npaths are already staged to be committed for you, and paths that conflicted are left in\nunmerged state. You would have to first check which paths are conflicting with git status and\nafter fixing them manually in your working tree, you would stage the result as usual with git\nadd:\n\n$ git status | grep unmerged\nunmerged: hello.c\n$ edit hello.c\n$ git add hello.c\n\n\nAfter resolving conflicts and staging the result, git ls-files -u would stop mentioning the\nconflicted path. When you are done, run git commit to finally record the merge:\n\n$ git commit\n\n\nAs with the case to record your own changes, you can use -a option to save typing. One\ndifference is that during a merge resolution, you cannot use git commit with pathnames to\nalter the order the changes are committed, because the merge should be recorded as a single\ncommit. In fact, the command refuses to run when given pathnames (but see -i option).\n",
                "subsections": []
            },
            "COMMIT INFORMATION": {
                "content": "Author and committer information is taken from the following environment variables, if set:\n\nGITAUTHORNAME\nGITAUTHOREMAIL\nGITAUTHORDATE\nGITCOMMITTERNAME\nGITCOMMITTEREMAIL\nGITCOMMITTERDATE\n\n(nb \"<\", \">\" and \"\\n\"s are stripped)\n\nThe author and committer names are by convention some form of a personal name (that is, the\nname by which other humans refer to you), although Git does not enforce or require any\nparticular form. Arbitrary Unicode may be used, subject to the constraints listed above. This\nname has no effect on authentication; for that, see the credential.username variable in git-\nconfig(1).\n\nIn case (some of) these environment variables are not set, the information is taken from the\nconfiguration items user.name and user.email, or, if not present, the environment variable\nEMAIL, or, if that is not set, system user name and the hostname used for outgoing mail\n(taken from /etc/mailname and falling back to the fully qualified hostname when that file\ndoes not exist).\n\nThe author.name and committer.name and their corresponding email options override user.name\nand user.email if set and are overridden themselves by the environment variables.\n\nThe typical usage is to set just the user.name and user.email variables; the other options\nare provided for more complex use cases.\n",
                "subsections": []
            },
            "DATE FORMATS": {
                "content": "The GITAUTHORDATE and GITCOMMITTERDATE environment variables support the following date\nformats:\n\nGit internal format\nIt is <unix timestamp> <time zone offset>, where <unix timestamp> is the number of\nseconds since the UNIX epoch.  <time zone offset> is a positive or negative offset from\nUTC. For example CET (which is 1 hour ahead of UTC) is +0100.\n\nRFC 2822\nThe standard email format as described by RFC 2822, for example Thu, 07 Apr 2005 22:13:13\n+0200.\n\nISO 8601\nTime and date specified by the ISO 8601 standard, for example 2005-04-07T22:13:13. The\nparser accepts a space instead of the T character as well. Fractional parts of a second\nwill be ignored, for example 2005-04-07T22:13:13.019 will be treated as\n2005-04-07T22:13:13.\n\nNote\nIn addition, the date part is accepted in the following formats: YYYY.MM.DD,\nMM/DD/YYYY and DD.MM.YYYY.\n\nIn addition to recognizing all date formats above, the --date option will also try to make\nsense of other, more human-centric date formats, such as relative dates like \"yesterday\" or\n\"last Friday at noon\".\n",
                "subsections": []
            },
            "DISCUSSION": {
                "content": "Though not required, it’s a good idea to begin the commit message with a single short (less\nthan 50 character) line summarizing the change, followed by a blank line and then a more\nthorough description. The text up to the first blank line in a commit message is treated as\nthe commit title, and that title is used throughout Git. For example, git-format-patch(1)\nturns a commit into email, and it uses the title on the Subject line and the rest of the\ncommit in the body.\n\nGit is to some extent character encoding agnostic.\n\n•   The contents of the blob objects are uninterpreted sequences of bytes. There is no\nencoding translation at the core level.\n\n•   Path names are encoded in UTF-8 normalization form C. This applies to tree objects, the\nindex file, ref names, as well as path names in command line arguments, environment\nvariables and config files (.git/config (see git-config(1)), gitignore(5),\ngitattributes(5) and gitmodules(5)).\n\nNote that Git at the core level treats path names simply as sequences of non-NUL bytes,\nthere are no path name encoding conversions (except on Mac and Windows). Therefore, using\nnon-ASCII path names will mostly work even on platforms and file systems that use legacy\nextended ASCII encodings. However, repositories created on such systems will not work\nproperly on UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa. Additionally,\nmany Git-based tools simply assume path names to be UTF-8 and will fail to display other\nencodings correctly.\n\n•   Commit log messages are typically encoded in UTF-8, but other extended ASCII encodings\nare also supported. This includes ISO-8859-x, CP125x and many others, but not UTF-16/32,\nEBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5, EUC-x, CP9xx etc.).\n\nAlthough we encourage that the commit log messages are encoded in UTF-8, both the core and\nGit Porcelain are designed not to force UTF-8 on projects. If all participants of a\nparticular project find it more convenient to use legacy encodings, Git does not forbid it.\nHowever, there are a few things to keep in mind.\n\n1. git commit and git commit-tree issues a warning if the commit log message given to it\ndoes not look like a valid UTF-8 string, unless you explicitly say your project uses a\nlegacy encoding. The way to say this is to have i18n.commitEncoding in .git/config file,\nlike this:\n\n[i18n]\ncommitEncoding = ISO-8859-1\n\nCommit objects created with the above setting record the value of i18n.commitEncoding in\nits encoding header. This is to help other people who look at them later. Lack of this\nheader implies that the commit log message is encoded in UTF-8.\n\n2. git log, git show, git blame and friends look at the encoding header of a commit object,\nand try to re-code the log message into UTF-8 unless otherwise specified. You can specify\nthe desired output encoding with i18n.logOutputEncoding in .git/config file, like this:\n\n[i18n]\nlogOutputEncoding = ISO-8859-1\n\nIf you do not have this configuration variable, the value of i18n.commitEncoding is used\ninstead.\n\nNote that we deliberately chose not to re-code the commit log message when a commit is made\nto force UTF-8 at the commit object level, because re-coding to UTF-8 is not necessarily a\nreversible operation.\n",
                "subsections": []
            },
            "ENVIRONMENT AND CONFIGURATION VARIABLES": {
                "content": "The editor used to edit the commit log message will be chosen from the GITEDITOR environment\nvariable, the core.editor configuration variable, the VISUAL environment variable, or the\nEDITOR environment variable (in that order). See git-var(1) for details.\n",
                "subsections": []
            },
            "HOOKS": {
                "content": "This command can run commit-msg, prepare-commit-msg, pre-commit, post-commit and post-rewrite\nhooks. See githooks(5) for more information.\n",
                "subsections": []
            },
            "FILES": {
                "content": "$GITDIR/COMMITEDITMSG\nThis file contains the commit message of a commit in progress. If git commit exits due to\nan error before creating a commit, any commit message that has been provided by the user\n(e.g., in an editor session) will be available in this file, but will be overwritten by\nthe next invocation of git commit.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "git-add(1), git-rm(1), git-mv(1), git-merge(1), git-commit-tree(1)\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\n\n\nGit 2.34.1                                   02/26/2026                                GIT-COMMIT(1)",
                "subsections": []
            }
        }
    }
}