You can help translate this page.
Setup and Config
Getting and Creating Projects
Basic Snapshotting
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
Patching
Debugging
External Systems
Server Admin
Guides
- gitattributes
- Command-line interface conventions
- Everyday Git
- Frequently Asked Questions (FAQ)
- Glossary
- Hooks
- gitignore
- gitmodules
- Revisions
- Submodules
- Tutorial
- Workflows
- All guides...
Administration
Plumbing Commands
-
2.55.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2026-06-29
-
2.54.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2026-04-20
-
2.53.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2026-02-02
-
2.52.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2025-11-17
- 2.51.1 2.51.2 no changes
-
2.51.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2025-08-18
- 2.50.1 no changes
-
2.50.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
2025-06-16
- 2.49.1 no changes
-
2.49.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2025-03-14
- 2.46.2 2.48.2 no changes
-
2.46.1
[green-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2024-09-13
- 2.45.1 2.46.0 no changes
-
2.45.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2024-04-29
- 2.43.2 2.44.4 no changes
-
2.43.1
[green-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2024-02-09
-
2.43.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2023-11-20
- 2.38.1 2.42.4 no changes
-
2.38.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2022-10-02
- 2.35.1 2.37.7 no changes
-
2.35.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2022-01-24
- 2.34.1 2.34.8 no changes
-
2.34.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2021-11-15
- 2.33.1 2.33.8 no changes
-
2.33.0
[green-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2021-08-16
- 2.32.1 2.32.7 no changes
-
2.32.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2021-06-06
- 2.31.1 2.31.8 no changes
-
2.31.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2021-03-15
- 2.30.1 2.30.9 no changes
-
2.30.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2020-12-27
- 2.27.1 2.29.3 no changes
-
2.27.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2020-06-01
- 2.25.2 2.26.3 no changes
-
2.25.1
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2020-02-17
-
2.25.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2020-01-13
- 2.24.1 2.24.4 no changes
-
2.24.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2019-11-04
- 2.23.1 2.23.4 no changes
-
2.23.0
[green-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2019-08-16
- 2.21.1 2.22.5 no changes
-
2.21.0
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2019-02-24
- 2.17.0 2.20.5 no changes
-
2.16.6
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2019-12-06
- 2.14.6 2.15.4 no changes
-
2.13.7
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2018-05-22
-
2.12.5
[green-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2017-09-22
-
2.11.4
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2017-09-22
-
2.10.5
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2017-09-22
-
2.9.5
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2017-07-30
- 2.8.6 no changes
-
2.7.6
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2017-07-30
-
2.6.7
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2017-05-05
- 2.5.6 no changes
-
2.4.12
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2017-05-05
- 2.3.10 no changes
-
2.2.3
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
[grey-dot.png]
2015-09-04
- 2.1.4 no changes
-
2.0.5
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[green-dot.png]
[red-dot.png]
[red-dot.png]
[grey-dot.png]
[grey-dot.png]
2014-12-17
Check your version of git by running
git --version
gitcommit[-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]).
, , :
-
git-add[1] ("add") ,
commit(: ); -
git-rm[1] ,
commit; -
commit(--interactive--patch); , , , ( Git); -
-acommit"add" (.. , ) "rm" , , ; -
--interactive--patchcommit, , , ( , ), . . git-add[1], .
--dry-run , , ( ).
- , git reset.
-
-a -
--all -
, , , Git .
-
-p -
--patch -
, , . . git-add[1].
-
-U<n> -
--unified=<n> -
<> .
diff.context3, . (-U<>-p- ). -
--inter-hunk-context=<n> -
<n> , .
diff.interHunkContext0, .
-
-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!", <>,gitrebase--autosquash.-m- , , "fixup!"- <>gitrebase--autosquash.,
--fixup=amend:<>, , "amend!". <> "amend!"- , .gitrebase--autosquash"amend!"- <>, <> "amend!"-. "amend!"- ,--allow-empty-message.--fixup=reword:<>--fixup=amend:<>--only. "amend!"-, ( , ).gitrebase--autosquash<>, <>, .gitrebase--autosquash, "fixup!", "amend!" <>. . git-rebase[1]. -
--squash=<> -
gitrebase--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>. <> , - (..
gitrev-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.signoffgitfaq[7].
-
--trailer<>[(=|:)<>] -
(<>,<>), . (, git commit --trailer "Signed-off-by: <committer@example.com>" --trailer "Helped-by: <committer@example.com>"
Signed-off-byHelped-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,scissorsdefault.commit.cleanup(c. git-config[1]). -
-e -
--edit -
, <>
-F<>,-m<>-C<>. -
--no-edit -
. ,
gitcommit--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 -
, , , , . - ,
gitcommit; .--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, .. .:
truenormalfalseno.status.showUntrackedFiles, git-config[1]. -
-v -
--verbose -
( )
HEAD, , , . ,#, . .commit.verbosegit-config[1]., , .. , .
-
-q -
--quiet -
.
-
--dry-run -
, , , , , , .
-
--status -
git-status[1] . ,
commit.status. -
--no-status -
-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,07Apr200522: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 . , .
-
gitcommitgitcommit-tree, UTF-8, , . ,i18n.commitEncoding.git/config, :[i18n] commitEncoding = ISO-8859-1
-, ,
i18n.commitEncodingencoding. , . , UTF-8. -
gitlog,gitshow,gitblameencoding-, 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-msg, prepare-commit-msg, pre-commit, post-commit post-rewrite. . githooks[5].