GIT-COMMIT(1) (NAME) git-commit - (SYNOPSIS) git commit [-a | --interactive | --patch] [-s] [-v] [-u[]] [--amend] [--dry-run] [(-c | -C | --squash) | --fixup [(amend|reword):]] [-F | -m ] [--reset-author] [--allow-empty] [--allow-empty-message] [--no-verify] [-e] [--author=] [--date=] [--cleanup=] [--[no-]status] [-i | -o] [--pathspec-from-file= [--pathspec-file-nul]] [(--trailer [(=|:)])...] [-S[]] [--] [...] (DESCRIPTION) . HEAD ( git-checkout(1) HEAD <<>> (detached) ). : 1. git-add(1) << >> commit (: <<>> ) 2. git-rm(1) commit 3. commit ( --interactive --patch) () ( ) 4. -a commit << >> ( ) << >> 5. --interactive --patch commit (hunks) . "Interactive Mode" git-add(1) . --dry-run ( ) . git reset . (OPTIONS) -a, --all () . -p, --patch (patch) . git-add(1) . -U, --unified= diff (context). diff.context ( ) . ( -U -p ). --inter-hunk-context= diff . diff.interHunkContext 0 . -C , --reuse-message= ( ) . -c , --reedit-message= -C -c . --fixup=[(amend|reword):] git rebase --autosquash <<>> (fix up) . --fixup= <> . --fixup=amend: <> <> . --fixup=reword: <> . --fixup= <> git rebase --autosquash . -m <> git rebase --autosquash (squash) . --fixup=amend: <> . <> . git rebase --autosquash <> (squash) <> . <> --allow-empty-message . --fixup=reword: --fixup=amend: --only . <> ( ). git rebase --autosquash (squash) . <> <> git rebase --autosquash . git-rebase(1) . --squash= git rebase --autosquash . "squash! " . (-m/-c/-C/-F) . git-rebase(1) . --reset-author -C/-c/--amend cherry-pick . . --short (dry-run) . git-status(1) . --dry-run . --branch . git- status(1) . --porcelain (dry-run) (porcelain) . git-status(1) . --dry-run . --long (dry-run) . git-status(1) . --dry-run . -z, --null short porcelain git-status(1) LF NUL . --porcelain . -z <<>> core.quotePath ( git-config(1) ). -F , --file= . (standard input) - . --author= . A U Thor . ( git rev-list --all -i --author=) . --date= . -m , --message= . -m . -m -c -C -F ( ). -t , --template= . commit.template . . . -m -F . -s, --signoff, --no-signoff () Signed-off-by . signoff . () Developer Certificate of Origin . ( https://developercertificate.org .) signoff . --no-signoff --signoff . --signoff ( ) commit.signoff gitfaq(7) . --trailer [(=|:)] (, ) () . ( git commit --trailer "Signed-off-by:C O Mitter \ " --trailer "Helped-by:C O Mitter \ " () Signed-off-by () Helped-by .) trailer.* (git-interpret-trailers(1)) . -n, --verify, --no-verify pre-commit commit-msg . githooks(5) . --allow-empty . SCM . --allow-empty-message (plumbing) git-commit-tree(1) . --allow-empty SCM . --cleanup= . strip whitespace verbatim scissors default . strip . whitespace strip # . verbatim . scissors whitespace ( ) . "#" core.commentChar . # ------------------------ >8 ------------------------ default strip whitespace . commit.cleanup (: git-config(1)). -e, --edit -F -m -C . --no-edit . git commit --amend --no-edit . --amend . ( -i -o pathspec ) -m -F -c . ( --reset-author ). : $ git reset --soft HEAD^ $ ... do something else to come up with the right tree ... $ git commit -c ORIG_HEAD (merge commit) . . ( "RECOVERING FROM UPSTREAM REBASE" git-rebase(1) .) --no-post-rewrite post-rewrite . -i, --include () . . -o, --only . git commit . --amend . --allow-empty . --pathspec-from-file= (pathspec) . - . pathspec LF CR/LF . pathspec core.quotePath (: git-config(1)). --pathspec-file-nul --literal-pathspecs . --pathspec-file-nul --pathspec-from-file . pathspec NUL ( ). -u[], --untracked-files[=] . ( all ) -u normal . : no normal all . true normal false no . status.showUntrackedFiles git-config(1) . -v, --verbose (unified diff) HEAD . diff # . diff . commit.verbose git-config(1) . . -q, --quiet ( ). --dry-run . --status git-status(1) . commit.status . --no-status git-status(1) . -S[], --gpg-sign[=], --no-gpg-sign GPG . . --no-gpg-sign commit.gpgSign --gpg-sign . -- . ... pathspec . () . pathspec gitglossary(7) . (EXAMPLES) git add <<>> (index) . git restore --staged ( ) git add . git commit ( ) . . : $ edit hello.c $ git rm goodbye.c $ git add hello.c $ git commit git commit git add git rm . : $ edit hello.c $ rm goodbye.c $ git commit -a git commit -a hello.c goodbye.c git add git rm . git commit . : $ edit hello.c hello.h $ git add hello.c hello.h $ edit Makefile $ git commit Makefile Makefile . hello.c hello.h . -- . : $ git commit hello.c hello.h . ( git merge git pull ) . git status git add : $ git status | grep unmerged unmerged: hello.c $ edit hello.c $ git add hello.c git ls-files -u . git commit : $ git commit -a . git commit . ( -i ). (COMMIT INFORMATION) : o GIT_AUTHOR_NAME o GIT_AUTHOR_EMAIL o GIT_AUTHOR_DATE o GIT_COMMITTER_NAME o GIT_COMMITTER_EMAIL o GIT_COMMITTER_DATE (: <<<>> <<>>> <<\n>> ) ( ) . . credential.username git-config(1) . ( ) user.name user.email EMAIL ( /etc/mailname ) . author.name committer.name user.name user.email . user.name user.email . (DATE FORMATS) GIT_AUTHOR_DATE GIT_COMMITTER_DATE : (Git internal format) (UNIX epoch) . (UTC) . CET ( UTC ) +0100 . @ ( @0 +0000) . ( ) YYYYMMDD . RFC 2822 RFC 2822 Thu, 07 Apr 2005 22:13:13 +0200. ISO 8601 ISO 8601 2005-04-07T22:13:13. T . 2005-04-07T22:13:13.019 2005-04-07T22:13:13 . : YYYY.MM.DD, MM/DD/YYYY DD.MM.YYYY. --date <> <> . (DISCUSSION) ( ) . . git- format-patch(1) (Subject) . (character encoding) () . o blob . . o C (UTF-8 normalization form C) . (.git/config ( git-config(1)) gitignore(5) gitattributes(5) gitmodules(5)) . NUL ( ). ASCII ASCII . UTF-8 ( ) . UTF-8 . o UTF-8 ASCII . ISO-8859-x CP125x UTF-16/32 EBCDIC CJK ( GBK Shift-JIS Big5 EUC-x CP9xx ). UTF-8 (Git Porcelain) UTF-8 . . . 1. git commit git commit-tree UTF-8 . i18n.commitEncoding .git/config : [i18n] commitEncoding = ISO-8859-1 i18n.commitEncoding encoding . . UTF-8 . 2. git log git show git blame encoding UTF-8 . i18n.logOutputEncoding .git/config : [i18n] logOutputEncoding = ISO-8859-1 i18n.commitEncoding . UTF-8 UTF-8 . (ENVIRONMENT AND CONFIGURATION VARIABLES) GIT_EDITOR core.editor VISUAL EDITOR . git-var(1) . git- config(1) . : commit.cleanup --cleanup git commit . ( core.commentChar #) git config commit.cleanup whitespace ( ). commit.gpgSign (boolean) GPG . (rebase) . (agent) GPG . commit.status / . true . commit.template . commit.verbose (int) (verbosity) git commit. (HOOKS) commit-msg prepare-commit-msg pre-commit post-commit post-rewrite . githooks(5) . (FILES) $GIT_DIR/COMMIT_EDITMSG . git commit ( ) git commit . (SEE ALSO) git-add(1), git-rm(1), git-mv(1), git-merge(1), git-commit-tree(1) (GIT) git(1) Git 2.55.0 2026-06-29 GIT-COMMIT(1)