diff --git a/.gitattributes b/.gitattributes index a727d7ab9bdcb1..532b246caeb1f0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ -* whitespace=!indent,trail,space -*.[ch] whitespace=indent,trail,space diff=cpp -*.sh whitespace=indent,trail,space text eol=lf +* whitespace=trail,space +*.[ch] whitespace=indent,trail,space,incomplete diff=cpp +*.sh whitespace=indent,trail,space,incomplete text eol=lf *.perl text eol=lf diff=perl *.pl text eof=lf diff=perl *.pm text eol=lf diff=perl @@ -8,7 +8,7 @@ *.bat text eol=crlf *.png binary CODE_OF_CONDUCT.md -whitespace -/Documentation/**/*.adoc text eol=lf +/Documentation/**/*.adoc text eol=lf whitespace=trail,space,incomplete /command-list.txt text eol=lf /GIT-VERSION-GEN text eol=lf /mergetools/* text eol=lf @@ -18,3 +18,4 @@ CODE_OF_CONDUCT.md -whitespace /Documentation/gitk.adoc conflict-marker-size=32 /Documentation/user-manual.adoc conflict-marker-size=32 /t/t????-*.sh conflict-marker-size=32 +/t/unit-tests/clar/test/expected/* whitespace=-blank-at-eof diff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml index e2c3dbdcb50f0c..95e55134bdbed4 100644 --- a/.github/workflows/l10n.yml +++ b/.github/workflows/l10n.yml @@ -63,7 +63,7 @@ jobs: origin \ ${{ github.ref }} \ $args - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v6 with: go-version: '>=1.16' cache: false diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 698cf0d87f93f9..39e7e63c986bd1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -301,7 +301,17 @@ jobs: path: build - name: Test shell: pwsh - run: meson test -C build --no-rebuild --print-errorlogs --slice "$(1+${{ matrix.nr }})/10" + run: ci/run-test-slice-meson.sh build ${{matrix.nr}} 10 + - name: print test failures + if: failure() && env.FAILED_TEST_ARTIFACTS != '' + shell: bash + run: ci/print-test-failures.sh + - name: Upload failed tests' directories + if: failure() && env.FAILED_TEST_ARTIFACTS != '' + uses: actions/upload-artifact@v4 + with: + name: failed-tests-windows-meson-${{ matrix.nr }} + path: ${{env.FAILED_TEST_ARTIFACTS}} regular: name: ${{matrix.vector.jobname}} (${{matrix.vector.pool}}) @@ -436,7 +446,7 @@ jobs: - run: ci/install-dependencies.sh - run: useradd builder --create-home - run: chown -R builder . - - run: chmod o+w $GITHUB_ENV && sudo --preserve-env --set-home --user=builder ci/run-build-and-tests.sh + - run: chmod a+w $GITHUB_ENV && sudo --preserve-env --set-home --user=builder ci/run-build-and-tests.sh - name: print test failures if: failure() && env.FAILED_TEST_ARTIFACTS != '' run: sudo --preserve-env --set-home --user=builder ci/print-test-failures.sh diff --git a/.mailmap b/.mailmap index 7b3198171fad1e..3cf26b1add06cd 100644 --- a/.mailmap +++ b/.mailmap @@ -140,8 +140,8 @@ Junio C Hamano Kaartic Sivaraam Karl Wiberg Karl Hasselström Karl Wiberg -Karsten Blees -Karsten Blees +Karsten Blees +Karsten Blees Kay Sievers Kay Sievers Kazuki Saitoh kazuki saitoh diff --git a/Documentation/Makefile b/Documentation/Makefile index 04e9e10b2769f3..2699f0b24af192 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -53,6 +53,7 @@ MAN7_TXT += gitcli.adoc MAN7_TXT += gitcore-tutorial.adoc MAN7_TXT += gitcredentials.adoc MAN7_TXT += gitcvs-migration.adoc +MAN7_TXT += gitdatamodel.adoc MAN7_TXT += gitdiffcore.adoc MAN7_TXT += giteveryday.adoc MAN7_TXT += gitfaq.adoc @@ -142,6 +143,7 @@ TECH_DOCS += technical/shallow TECH_DOCS += technical/sparse-checkout TECH_DOCS += technical/sparse-index TECH_DOCS += technical/trivial-merge +TECH_DOCS += technical/unambiguous-types TECH_DOCS += technical/unit-tests SP_ARTICLES += $(TECH_DOCS) SP_ARTICLES += technical/api-index diff --git a/Documentation/RelNotes/2.53.0.adoc b/Documentation/RelNotes/2.53.0.adoc new file mode 100644 index 00000000000000..dcdebe8954f067 --- /dev/null +++ b/Documentation/RelNotes/2.53.0.adoc @@ -0,0 +1,280 @@ +Git v2.53 Release Notes +======================= + +UI, Workflows & Features +------------------------ + + * "git maintenance" command learned "is-needed" subcommand to tell if + it is necessary to perform various maintenance tasks. + + * "git replay" (experimental) learned to perform ref updates itself + in a transaction by default, instead of emitting where each refs + should point at and leaving the actual update to another command. + + * "git blame" learns "--diff-algorithm=" option. + + * "git repo info" learned "--all" option. + + * Both "git apply" and "git diff" learn a new whitespace error class, + "incomplete-line". + + * Add a new manual that describes the data model. + + * "git fast-import" learns "--strip-if-invalid" option to drop + invalid cryptographic signature from objects. + + * The use of "revision" (a connected set of commits) has been + clarified in the "git replay" documentation. + + * A help message from "git branch" now mentions "git help" instead of + "man" when suggesting to read some documentation. + + * "git repo struct" learned to take "-z" as a synonym to "--format=nul". + + * More object database related information are shown in "git repo + structure" output. + + * Improve the error message when a bad argument is given to the + `--onto` option of "git replay". Test coverage of "git replay" has + been improved. + + +Performance, Internal Implementation, Development Support etc. +-------------------------------------------------------------- + + * The list of packfiles used in a running Git process is moved from + the packed_git structure into the packfile store. + + * Some ref backend storage can hold not just the object name of an + annotated tag, but the object name of the object the tag points at. + The code to handle this information has been streamlined. + + * As "git diff --quiet" only cares about the existence of any + changes, disable rename/copy detection to skip more expensive + processing whose result will be discarded anyway. + + * A part of code paths that deals with loose objects has been cleaned + up. + + * "make strip" has been taught to strip "scalar" as well as "git". + + * Dockerised jobs at the GitHub Actions CI have been taught to show + more details of failed tests. + + * Code refactoring around object database sources. + + * Halve the memory consumed by artificial filepairs created during + "git diff --find-copioes-harder", also making the operation run + faster. + + * The "git_istream" abstraction has been revamped to make it easier + to interface with pluggable object database design. + + * Rewrite the only use of "mktemp()" that is subject to TOCTOU race + and Stop using the insecure "mktemp()" function. + (merge 10bba537c4 rs/ban-mktemp later to maint). + + * In-code comment update to clarify that single-letter options are + outside of the scope of command line completion script. + (merge dc8a00fafe jc/completion-no-single-letter-options later to maint). + + * MEMZERO_ARRAY() helper is introduced to avoid clearing only the + first N bytes of an N-element array whose elements are larger than + a byte. + + * "git diff-files -R --find-copies-harder" has been taught to use + the potential copy sources from the index correctly. + + * Require C99 style flexible array member support from all platforms. + + * The code path that enumerates promisor objects have been optimized + to skip pointlessly parsing blob objects. + + * Prepare test suite for Git for Windows that supports symbolic + links. + + * Use hook API to replace ad-hoc invocation of hook scripts with the + run_command() API. + + * Import newer version of "clar", unit testing framework. + (merge 84071a6dea ps/clar-integers later to maint). + + +Fixes since v2.52 +----------------- + + * Ever since we added whitespace rules for this project, we misspelt + an entry, which has been corrected. + (merge 358e94dc70 jc/gitattributes-whitespace-no-indent-fix later to maint). + + * The code to expand attribute macros has been rewritten to avoid + recursion to avoid running out of stack space in an uncontrolled + way. + (merge 42ed046866 jk/attr-macroexpand-wo-recursion later to maint). + + * Adding a repository that uses a different hash function is a no-no, + but "git submodule add" did nt prevent it, which has been corrected. + (merge 6fe288bfbc bc/submodule-force-same-hash later to maint). + + * An earlier check added to osx keychain credential helper to avoid + storing the credential itself supplied was overeager and rejected + credential material supplied by other helper backends that it would + have wanted to store, which has been corrected. + (merge 4580bcd235 kn/osxkeychain-idempotent-store-fix later to maint). + + * The "git repo structure" subcommand tried to align its output but + mixed up byte count and display column width, which has been + corrected. + (merge 7a03a10a3a jx/repo-struct-utf8width-fix later to maint). + + * Yet another corner case fix around renames in the "ort" merge + strategy. + (merge a562d90a35 en/ort-rename-another-fix later to maint). + + * Test leakfix. + (merge 14b561e768 jk/test-mktemp-leakfix later to maint). + + * Update a version of action used at the GitHub Actrions CI. + (merge cd99203f86 js/ci-github-setup-go-update later to maint). + + * The "return errno = EFOO, -1" construct, which is heavily used in + compat/mingw.c and triggers warnings under "-Wcomma", has been + rewritten to avoid the warnings. + (merge af3919816f js/mingw-assign-comma-fix later to maint). + + * Makefile based build have recently been updated to build a + libgit.a that also has reftable and xdiff objects; CMake based + build procedure has been updated to match. + (merge b0d5c88cca js/cmake-libgit-fix later to maint). + + * Under-allocation fix. + (merge d22a488482 js/wincred-get-credential-alloc-fix later to maint). + + * "git worktree list" attempts to show paths to worktrees while + aligning them, but miscounted display columns for the paths when + non-ASCII characters were involved, which has been corrected. + (merge 08dfa59835 pw/worktree-list-display-width-fix later to maint). + + * "Windows+meson" job at the GitHub Actions CI was hard to debug, as + it did not show and save failed test artifacts, which has been + corrected. + (merge 17bd1108ea jk/ci-windows-meson-test-fix later to maint). + + * Emulation code clean-up. + (merge 2367c6bcd6 gf/win32-pthread-cond-wait-err later to maint). + + * Various issues detected by Asan have been corrected. + (merge a031b6181a jk/asan-bonanza later to maint). + + * "git config get --path" segfaulted on an ":(optional)path" that + does not exist, which has been corrected. + (merge 0bd16856ff jc/optional-path later to maint). + + * The "--committer-date-is-author-date" option of "git am/rebase" is + a misguided one. The documentation is updated to discourage its + use. + (merge fbf3d0669f kh/doc-committer-date-is-author-date later to maint). + + * The option help text given by "git config unset -h" described + the "--all" option to "replace", not "unset", multiple variables, + which has been corrected. + (merge 18bf67b753 rs/config-unset-opthelp-fix later to maint). + + * The error message given by "git config set", when the variable + being updated has more than one values defined, used old style "git + config" syntax with an incorrect option in its hint, both of which + have been corrected. + (merge df963f0df4 rs/config-set-multi-error-message-fix later to maint). + + * "git replay" forgot to omit the "gpgsig-sha256" extended header + from the resulting commit the same way it omits "gpgsig", which has + been corrected. + (merge 9f3a115087 pw/replay-exclude-gpgsig-fix later to maint). + + * A few tests have been updated to work under the shell compatible + mode of zsh. + (merge a92f243a94 bc/zsh-testsuite later to maint). + + * The way patience diff finds LCS has been optimized. + (merge c7e3b8085b yc/xdiff-patience-optim later to maint). + + * Recent optimization to "last-modified" command introduced use of + uninitialized block of memory, which has been corrected. + (merge fe4e60759b tc/last-modified-active-paths-optimization later to maint). + + * "git last-modified" used to mishandle "--" to mark the beginning of + pathspec, which has been corrected. + (merge 05491b90ce js/last-modified-with-sparse-checkouts later to maint). + + * Emulation code clean-up. + (merge 42aa7603aa gf/win32-pthread-cond-init later to maint). + + * "git submodule add" to add a submodule under segfaulted, + when a submodule..something is already in .gitmodules file + without defining where its submodule..path is, which has been + corrected. + (merge dd8e8c786e jc/submodule-add later to maint). + + * "git fetch" that involves fetching tags, when a tag being fetched + needs to overwrite existing one, failed to fetch other tags, which + has been corrected. + (merge b7b17ec8a6 kn/fix-fetch-backfill-tag-with-batched-ref-updates later to maint). + + * Document "rev-list --filter-provided-objects" better. + (merge 6d8dc99478 jt/doc-rev-list-filter-provided-objects later to maint). + + * Even when there is no changes in the packfile and no need to + recompute bitmaps, "git repack" recomputed and updated the MIDX + file, which has been corrected. + (merge 6ce9d558ce ps/repack-avoid-noop-midx-rewrite later to maint). + + * Update HTTP tests to adjust for changes in curl 8.18.0 + (merge 17f4b01da7 jk/test-curl-updates later to maint). + + * Workaround the "iconv" shipped as part of macOS, which is broken + handling stateful ISO/IEC 2022 encoded strings. + (merge cee341e9dd rs/macos-iconv-workaround later to maint). + + * Running "git diff" with "--name-only" and other options that allows + us not to look at the blob contents, while objects that are lazily + fetched from a promisor remote, caused use-after-free, which has + been corrected. + + * The ort merge machinery hit an assertion failure in a history with + criss-cross merges renamed a directory and a non-directory, which + has been corrected. + (merge 979ee83e8a en/ort-recursive-d-f-conflict-fix later to maint). + + * Diagnose invalid bundle-URI that lack the URI entry, instead of + crashing. + (merge 7796c14a1a sb/bundle-uri-without-uri later to maint). + + * Mailmap update for Karsten + (merge e97678c4ef js/mailmap-karsten-blees later to maint). + + * Other code cleanup, docfix, build fix, etc. + (merge 46207a54cc qj/doc-http-bad-want-response later to maint). + (merge df90eccd93 kh/doc-commit-extra-references later to maint). + (merge f18aa68861 rs/xmkstemp-simplify later to maint). + (merge fddba8f737 ja/doc-synopsis-style later to maint). + (merge 22ce0cb639 en/xdiff-cleanup-2 later to maint). + (merge 8ef7355a8f je/doc-pull later to maint). + (merge 48176f953f jc/capability-leak later to maint). + (merge 8cbbdc92f7 kh/doc-pre-commit-fix later to maint). + (merge d4bc39a4d9 mh/doc-config-gui-gcwarning later to maint). + (merge 41d425008a kh/doc-send-email-paragraph-fix later to maint). + (merge d4b732899e jc/macports-darwinports later to maint). + (merge bab391761d kj/pull-options-decl-cleanup later to maint). + (merge 007b8994d4 rs/t4014-git-version-string-fix later to maint). + (merge 4ce170c522 ds/doc-scalar-config later to maint). + (merge a0c813951a jc/doc-commit-signoff-config later to maint). + (merge 8ee262985a ja/doc-misc-fixes later to maint). + (merge 1722c2244b mh/doc-core-attributesfile later to maint). + (merge c469ca26c5 dk/ci-rust-fix later to maint). + (merge 12f0be0857 gf/clear-path-cache-cleanup later to maint). + (merge 949df6ed6b js/test-func-comment-fix later to maint). + (merge 93f894c001 bc/checkout-error-message-fix later to maint). + (merge abf05d856f rs/show-branch-prio-queue later to maint). + (merge 06188ea5f3 rs/parse-config-expiry-simplify later to maint). + (merge 861dbb1586 dd/t5403-modernise later to maint). + (merge acffc5e9e5 ja/doc-synopsis-style-more later to maint). diff --git a/Documentation/config/core.adoc b/Documentation/config/core.adoc index 34c44d2c8f8725..eb8957d4daca94 100644 --- a/Documentation/config/core.adoc +++ b/Documentation/config/core.adoc @@ -492,10 +492,9 @@ core.askPass:: command-line argument and write the password on its STDOUT. core.attributesFile:: - In addition to `.gitattributes` (per-directory) and - `.git/info/attributes`, Git looks into this file for attributes - (see linkgit:gitattributes[5]). Path expansions are made the same - way as for `core.excludesFile`. Its default value is + Specifies the pathname to the file that contains attributes (see + linkgit:gitattributes[5]), in addition to `.gitattributes` (per-directory) + and `.git/info/attributes`. Its default value is `$XDG_CONFIG_HOME/git/attributes`. If `$XDG_CONFIG_HOME` is either not set or empty, `$HOME/.config/git/attributes` is used instead. @@ -629,6 +628,8 @@ core.whitespace:: part of the line terminator, i.e. with it, `trailing-space` does not trigger if the character before such a carriage-return is not a whitespace (not enabled by default). +* `incomplete-line` treats the last line of a file that is missing the + newline at the end as an error (not enabled by default). * `tabwidth=` tells how many character positions a tab occupies; this is relevant for `indent-with-non-tab` and when Git fixes `tab-in-indent` errors. The default tab width is 8. Allowed values are 1 to 63. diff --git a/Documentation/config/fetch.adoc b/Documentation/config/fetch.adoc index d7dc461bd16ad7..cd40db0cad1c36 100644 --- a/Documentation/config/fetch.adoc +++ b/Documentation/config/fetch.adoc @@ -1,32 +1,32 @@ -fetch.recurseSubmodules:: +`fetch.recurseSubmodules`:: This option controls whether `git fetch` (and the underlying fetch in `git pull`) will recursively fetch into populated submodules. - This option can be set either to a boolean value or to 'on-demand'. + This option can be set either to a boolean value or to `on-demand`. Setting it to a boolean changes the behavior of fetch and pull to recurse unconditionally into submodules when set to true or to not - recurse at all when set to false. When set to 'on-demand', fetch and + recurse at all when set to false. When set to `on-demand`, fetch and pull will only recurse into a populated submodule when its superproject retrieves a commit that updates the submodule's reference. - Defaults to 'on-demand', or to the value of 'submodule.recurse' if set. + Defaults to `on-demand`, or to the value of `submodule.recurse` if set. -fetch.fsckObjects:: +`fetch.fsckObjects`:: If it is set to true, git-fetch-pack will check all fetched objects. See `transfer.fsckObjects` for what's - checked. Defaults to false. If not set, the value of + checked. Defaults to `false`. If not set, the value of `transfer.fsckObjects` is used instead. -fetch.fsck.:: +`fetch.fsck.`:: Acts like `fsck.`, but is used by linkgit:git-fetch-pack[1] instead of linkgit:git-fsck[1]. See the `fsck.` documentation for details. -fetch.fsck.skipList:: +`fetch.fsck.skipList`:: Acts like `fsck.skipList`, but is used by linkgit:git-fetch-pack[1] instead of linkgit:git-fsck[1]. See the `fsck.skipList` documentation for details. -fetch.unpackLimit:: +`fetch.unpackLimit`:: If the number of objects fetched over the Git native transfer is below this limit, then the objects will be unpacked into loose object @@ -37,12 +37,12 @@ fetch.unpackLimit:: especially on slow filesystems. If not set, the value of `transfer.unpackLimit` is used instead. -fetch.prune:: +`fetch.prune`:: If true, fetch will automatically behave as if the `--prune` option was given on the command line. See also `remote..prune` and the PRUNING section of linkgit:git-fetch[1]. -fetch.pruneTags:: +`fetch.pruneTags`:: If true, fetch will automatically behave as if the `refs/tags/*:refs/tags/*` refspec was provided when pruning, if not set already. This allows for setting both this option @@ -50,41 +50,41 @@ fetch.pruneTags:: refs. See also `remote..pruneTags` and the PRUNING section of linkgit:git-fetch[1]. -fetch.all:: +`fetch.all`:: If true, fetch will attempt to update all available remotes. This behavior can be overridden by passing `--no-all` or by explicitly specifying one or more remote(s) to fetch from. - Defaults to false. + Defaults to `false`. -fetch.output:: +`fetch.output`:: Control how ref update status is printed. Valid values are `full` and `compact`. Default value is `full`. See the OUTPUT section in linkgit:git-fetch[1] for details. -fetch.negotiationAlgorithm:: +`fetch.negotiationAlgorithm`:: Control how information about the commits in the local repository is sent when negotiating the contents of the packfile to be sent by - the server. Set to "consecutive" to use an algorithm that walks - over consecutive commits checking each one. Set to "skipping" to + the server. Set to `consecutive` to use an algorithm that walks + over consecutive commits checking each one. Set to `skipping` to use an algorithm that skips commits in an effort to converge faster, but may result in a larger-than-necessary packfile; or set - to "noop" to not send any information at all, which will almost + to `noop` to not send any information at all, which will almost certainly result in a larger-than-necessary packfile, but will skip - the negotiation step. Set to "default" to override settings made + the negotiation step. Set to `default` to override settings made previously and use the default behaviour. The default is normally - "consecutive", but if `feature.experimental` is true, then the - default is "skipping". Unknown values will cause 'git fetch' to + `consecutive`, but if `feature.experimental` is `true`, then the + default is `skipping`. Unknown values will cause `git fetch` to error out. + See also the `--negotiate-only` and `--negotiation-tip` options to linkgit:git-fetch[1]. -fetch.showForcedUpdates:: - Set to false to enable `--no-show-forced-updates` in +`fetch.showForcedUpdates`:: + Set to `false` to enable `--no-show-forced-updates` in linkgit:git-fetch[1] and linkgit:git-pull[1] commands. - Defaults to true. + Defaults to `true`. -fetch.parallel:: +`fetch.parallel`:: Specifies the maximal number of fetch operations to be run in parallel at a time (submodules, or remotes when the `--multiple` option of linkgit:git-fetch[1] is in effect). @@ -94,16 +94,16 @@ A value of 0 will give some reasonable default. If unset, it defaults to 1. For submodules, this setting can be overridden using the `submodule.fetchJobs` config setting. -fetch.writeCommitGraph:: +`fetch.writeCommitGraph`:: Set to true to write a commit-graph after every `git fetch` command that downloads a pack-file from a remote. Using the `--split` option, most executions will create a very small commit-graph file on top of the existing commit-graph file(s). Occasionally, these files will merge and the write may take longer. Having an updated commit-graph file helps performance of many Git commands, including `git merge-base`, - `git push -f`, and `git log --graph`. Defaults to false. + `git push -f`, and `git log --graph`. Defaults to `false`. -fetch.bundleURI:: +`fetch.bundleURI`:: This value stores a URI for downloading Git object data from a bundle URI before performing an incremental fetch from the origin Git server. This is similar to how the `--bundle-uri` option behaves in @@ -115,9 +115,9 @@ If you modify this value and your repository has a `fetch.bundleCreationToken` value, then remove that `fetch.bundleCreationToken` value before fetching from the new bundle URI. -fetch.bundleCreationToken:: +`fetch.bundleCreationToken`:: When using `fetch.bundleURI` to fetch incrementally from a bundle - list that uses the "creationToken" heuristic, this config value + list that uses the "`creationToken`" heuristic, this config value stores the maximum `creationToken` value of the downloaded bundles. This value is used to prevent downloading bundles in the future if the advertised `creationToken` is not strictly larger than this diff --git a/Documentation/config/gui.adoc b/Documentation/config/gui.adoc index 171be774d243fd..1565c0af197b9c 100644 --- a/Documentation/config/gui.adoc +++ b/Documentation/config/gui.adoc @@ -55,3 +55,8 @@ gui.blamehistoryctx:: linkgit:gitk[1] for the selected commit, when the `Show History Context` menu item is invoked from 'git gui blame'. If this variable is set to zero, the whole history is shown. + +gui.GCWarning:: + Determines whether linkgit:git-gui[1] should prompt for garbage + collection when git detects a large number of loose objects in + the repository. The default value is "true". diff --git a/Documentation/config/push.adoc b/Documentation/config/push.adoc index 0acbbea18a320f..d9112b22609b51 100644 --- a/Documentation/config/push.adoc +++ b/Documentation/config/push.adoc @@ -1,15 +1,15 @@ -push.autoSetupRemote:: - If set to "true" assume `--set-upstream` on default push when no +`push.autoSetupRemote`:: + If set to `true` assume `--set-upstream` on default push when no upstream tracking exists for the current branch; this option - takes effect with push.default options 'simple', 'upstream', - and 'current'. It is useful if by default you want new branches + takes effect with `push.default` options `simple`, `upstream`, + and `current`. It is useful if by default you want new branches to be pushed to the default remote (like the behavior of - 'push.default=current') and you also want the upstream tracking + `push.default=current`) and you also want the upstream tracking to be set. Workflows most likely to benefit from this option are - 'simple' central workflows where all branches are expected to + `simple` central workflows where all branches are expected to have the same name on the remote. -push.default:: +`push.default`:: Defines the action `git push` should take if no refspec is given (whether from the command-line, config, or elsewhere). Different values are well-suited for @@ -18,24 +18,28 @@ push.default:: `upstream` is probably what you want. Possible values are: + -- - -* `nothing` - do not push anything (error out) unless a refspec is - given. This is primarily meant for people who want to - avoid mistakes by always being explicit. - -* `current` - push the current branch to update a branch with the same - name on the receiving end. Works in both central and non-central - workflows. - -* `upstream` - push the current branch back to the branch whose - changes are usually integrated into the current branch (which is - called `@{upstream}`). This mode only makes sense if you are - pushing to the same repository you would normally pull from - (i.e. central workflow). - -* `tracking` - This is a deprecated synonym for `upstream`. - -* `simple` - push the current branch with the same name on the remote. +`nothing`;; +do not push anything (error out) unless a refspec is +given. This is primarily meant for people who want to +avoid mistakes by always being explicit. + +`current`;; +push the current branch to update a branch with the same +name on the receiving end. Works in both central and non-central +workflows. + +`upstream`;; +push the current branch back to the branch whose +changes are usually integrated into the current branch (which is +called `@{upstream}`). This mode only makes sense if you are +pushing to the same repository you would normally pull from +(i.e. central workflow). + +`tracking`;; +this is a deprecated synonym for `upstream`. + +`simple`;; +push the current branch with the same name on the remote. + If you are working on a centralized workflow (pushing to the same repository you pull from, which is typically `origin`), then you need to configure an upstream @@ -44,16 +48,17 @@ branch with the same name. This mode is the default since Git 2.0, and is the safest option suited for beginners. -* `matching` - push all branches having the same name on both ends. - This makes the repository you are pushing to remember the set of - branches that will be pushed out (e.g. if you always push 'maint' - and 'master' there and no other branches, the repository you push - to will have these two branches, and your local 'maint' and - 'master' will be pushed there). +`matching`;; +push all branches having the same name on both ends. +This makes the repository you are pushing to remember the set of +branches that will be pushed out (e.g. if you always push `maint` +and `master` there and no other branches, the repository you push +to will have these two branches, and your local `maint` and +`master` will be pushed there). + To use this mode effectively, you have to make sure _all_ the branches you would push out are ready to be pushed out before -running 'git push', as the whole point of this mode is to allow you +running `git push`, as the whole point of this mode is to allow you to push all of the branches in one go. If you usually finish work on only one branch and push out the result, while other branches are unfinished, this mode is not for you. Also this mode is not @@ -66,24 +71,24 @@ new default). -- -push.followTags:: +`push.followTags`:: If set to true, enable `--follow-tags` option by default. You may override this configuration at time of push by specifying `--no-follow-tags`. -push.gpgSign:: - May be set to a boolean value, or the string 'if-asked'. A true +`push.gpgSign`:: + May be set to a boolean value, or the string `if-asked`. A true value causes all pushes to be GPG signed, as if `--signed` is - passed to linkgit:git-push[1]. The string 'if-asked' causes + passed to linkgit:git-push[1]. The string `if-asked` causes pushes to be signed if the server supports it, as if - `--signed=if-asked` is passed to 'git push'. A false value may + `--signed=if-asked` is passed to `git push`. A false value may override a value from a lower-priority config file. An explicit command-line flag always overrides this config option. -push.pushOption:: +`push.pushOption`:: When no `--push-option=