[ Web Proxy ]
URL:
Viewing: https://git-scm.com/docs/git-commit/ru [Back]  [Original]

Git - git-commit Documentation
Git [Git]
Type / to search entire site:
dark-mode.svg [dark-mode.svg]
Topics Latest version git-commit last updated in 2.55.0

git-commit -

git commit [-a | --interactive | --patch] [-s] [-v] [-u[<>]] [--amend]
	   [--dry-run] <>]
	   [-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[<id->]]
	   [--] [<->…​]

, , . HEAD, , , , ( - , .. , HEAD , git-checkout[1]).

, , :

  1. git-add[1] ("add") , commit (: );

  2. git-rm[1] , commit;

  3. commit ( --interactive --patch); , , , ( Git);

  4. -a commit "add" (.. , ) "rm" , , ;

  5. --interactive --patch commit, , , ( , ), . . git-add[1], .

--dry-run , , ( ).

- , git reset.

-a
--all

, , , Git .

-p
--patch

, , . . git-add[1].

-U<n>
--unified=<n>

<> . diff.context 3, . (-U <> -p - ).

--inter-hunk-context=<n>

<n> , . diff.interHunkContext 0, .

-C <>
--reuse-message=<>

<> ( ) .

-c <>
--reedit-message=<>

-C, -c , .

--fixup=[(amend|reword):]<>

, <>, git rebase --autosquash. --fixup=<> "fixup!"-, <>, . --fixup=amend:<> , "amend!"-, <> "amend!"-. --fixup=reword:<> "amend!"-, <> , <>.

, --fixup=<>, ( ) , "fixup!", <>, git rebase --autosquash . -m - , , "fixup!"- <> git rebase --autosquash.

, --fixup=amend:<>, , "amend!". <> "amend!"- , . git rebase --autosquash "amend!"- <>, <> "amend!"-. "amend!"- , --allow-empty-message.

--fixup=reword:<> --fixup=amend:<> --only. "amend!"-, ( , ). git rebase --autosquash <>, <>, .

git rebase --autosquash, "fixup!", "amend!" <>. . git-rebase[1].

--squash=<>

git rebase --autosquash. "squash!". , (-m/-c/-C/-F). . git-rebase[1].

--reset-author

-C/-c/--amend -, . .

--short

, . . git-status[1]. --dry-run.

--branch

( ) . . git-status[1].

--porcelain

, . . git-status[1]. --dry-run.

--long

. git-status[1]. --dry-run.

-z
--null

(short) (porcelain) git-status[1], NUL LF. , --porcelain. -z , core.quotePath (. git-config[1]).

-F <>
--file=<>

<>. "-" , .

--author=<>

. , : <author@example.com>. <> , - (.. 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 . , . , , , , - , ( Linux Git . https://developercertificate.org). , , , .

--no-signoff --signoff, .

Git ( ) --signoff ; . commit.signoff gitfaq[7].

--trailer <>[(=|:)<>]

(<>,<>), . (, git commit --trailer "Signed-off-by: <committer@example.com>" --trailer "Helped-by: <committer@example.com>" Signed-off-by Helped-by ). , , , trailer.* (. git-interpret-trailers[1]).

-n
--verify
--no-verify

pre-commit commit-msg. . githooks[5].

--allow-empty

, , () , , . ; , c .

--allow-empty-message

, git-commit-tree[1]. --allow-empty, , c .

--cleanup=<>

, , . <> : strip, whitespace, verbatim, scissors default.

strip

, , , .

whitespace

, strip, # .

verbatim

.

scissors

, whitespace, , , , ( ), . # core.commentChar.

# ------------------------ >8 ------------------------
default

, , strip. whitespace.

commit.cleanup (c. git-config[1]).

-e
--edit

, <> -F <>, -m <> -C <>.

--no-edit

. , git commit --amend --no-edit .

--amend

, . ( -i -o ) , , -m, -F, -c .., ( ). , ( --reset-author ).

:

	$ git reset --soft HEAD^
	$ ...  -,      ...
	$ git commit -c ORIG_HEAD

.

, , . (. REBASE git-rebase[1].)

--no-post-rewrite

post-rewrite.

-i
--include

, , , . , , , .

-o
--only

, , , , . - , git commit ; . --amend, , , . --allow-empty, ; .

--pathspec-from-file=<>

<>, . <> -, . LF CR/LF. , core.quotePath (. git-config[1]). . --pathspec-file-nul --literal-pathspecs.

--pathspec-file-nul

--pathspec-from-file. NUL-, ( ).

-u[<>]
--untracked-files[=<>]

.

<> ( : all) , ; -u , : normal, .. .

:

no

normal

all

.

true normal false no. status.showUntrackedFiles, git-config[1].

-v
--verbose

( ) HEAD , , , . , #, . . commit.verbose git-config[1].

, , .. , .

-q
--quiet

.

--dry-run

, , , , , , .

--status

git-status[1] . , commit.status.

--no-status

git-status[1] .

-S[<id->]
--gpg-sign[=<id->]
--no-gpg-sign

GPG. <id-> , , ; , , . --no-gpg-sign , commit.gpgSign --gpg-sign, .

--

.

<->

<->, , , , , . , , .

. (pathspec) gitglossary[7].

, ( git add) , . ( , ), 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 add . , , , :

$ 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).

, :

  • GIT_AUTHOR_NAME

  • GIT_AUTHOR_EMAIL

  • GIT_AUTHOR_DATE

  • GIT_COMMITTER_NAME

  • GIT_COMMITTER_EMAIL

  • GIT_COMMITTER_DATE

( , "<", ">" "\n" )

(.. , ), Git - . Unicode ( , ). ; . credential.username git-config[1].

( ) , user.name user.email; , , EMAIL; , , , ( /etc/mailname , , ).

author.name committer.name user.name user.email, , .

`user.name `user.email; .

GIT_AUTHOR_DATE GIT_COMMITTER_DATE :

Git

<unix-timestamp> <time-zone-offset>, <unix-timestamp> , UNIX (00:00:00 UTC 1 1970 ). <time-zone-offset> UTC. , CET ( 1 UTC) +0100.

RFC 2822

, RFC 2822, , Thu, 07 Apr 2005 22:13:13 +0200.

ISO 8601

, ISO 8601, , 2005-04-07T22:13:13'. `. , ‘2005-04-07T22:13:13.019’ ‘2005-04-07T22:13:13’.

Note
, : .., // ...

, --date , , , , "yesterday" () "last Friday at noon" ( ).

, , , ( 50 ) , , , . , Git . , git-format-patch[1], , , .

Git .

  • blob- , . Git .

  • UTF-8 C. -, , , , (.git/config (. git-config[1]), gitignore[5], gitattributes[5] gitmodules[5]).

    , Git , ( Mac Windows). , , -ASCII , , ASCII-. , , UTF-8 (, Linux, Mac, Windows) . , , Git, , UTF-8, .

  • , , UTF-8, ASCII- , : ISO-8859-x, CP125x , UTF-16/32, EBCDIC CJK (GBK, Shift-JIS, Big5, EUC-x, CP9xx ..).

, UTF-8 , Git, , UTF-8 . , Git . , .

  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 .

, , ( ) 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

, , GPG. (rebase), , . GPG , GPG-.

commit.status

, / . : true.

commit.template

, .

commit.verbose

, , git commit .

: commit-msg, prepare-commit-msg, pre-commit, post-commit post-rewrite. . githooks[5].

$GIT_DIR/COMMIT_EDITMSG

( ). git commit , , , , (, ), , , git commit.

GIT

About this site
Patches, suggestions, and comments are welcome.
Git is a member of Software Freedom Conservancy

Web Proxy Viewer  |  New URL  |  Original Page