- Add fetch.followRemoteHEAD configuration variable to provide a default for the per-remote remote.<name>.followRemoteHEAD setting
- Extend git refs toolbox with new create, delete, update, and rename subcommands
- Teach experimental git history command a new drop subcommand to remove a commit with its descendants replayed onto its parent
- Teach the [includeIf "condition"] conditional inclusion facility for configuration files to use the location of the worktree in its condition
- Add userdiff patterns for Swift with support for Swift-specific constructs such as attributes, modifiers, failable initializers, and generics
- Add remote-object-info command to git cat-file --batch-command to allow clients to request object metadata from a remote server via protocol v2 without downloading the entire object
- Teach git add a new --resolved option to stage conflict-resolved paths while leaving unrelated local changes unstaged
- Update advice shown by git status when the local branch is behind or has diverged from its push branch to suggest git pull <remote> <branch>
- Update handling of promisor-remote protocol capability to allow the other side to add to the list of promisor remotes via the promisor.acceptFromServerURL configuration variable
- Harden the ort merge backend against corrupt trees by ensuring it aborts under appropriate error conditions
- Update git log --follow to better handle non-linear history in which the path being tracked gets renamed differently in multiple history lines
- Teach git repo info command new keys to output both absolute and relative paths for gitdir and commondir
- Recognize git push origin/main or git branch origin main as a potential typo and add advice to offer a typo fix
- Optimize alignment of commit object name abbreviations in git blame output to reserve a column for marks only when such marks are actually shown
- Update option parsing with git rev-parse --parseopt and most git subcommands to exit with 0 instead of 129 when the help option is requested directly by the user
- Standardize the usage string and SYNOPSIS for git fast-export to make them consistent with each other and other commands
- Modify git log --graph to visually distinguish parentless root commits by indenting them
- Update configuration file locking to retry for a short period to avoid failures when multiple processes attempt to update the configuration simultaneously
- Teach git branch -d to report when a branch cannot be deleted because it is being used in an active bisect run
- Update git mv to check for a missing destination leading directory during the checking phase and improve the error message when the rename syscall fails
From Git
Git v2.56 Release Notes
UI, Workflows & Features
-
Advice shown by "git status" when the local branch is behind or has diverged from its push branch has been updated to suggest "git pull ".
-
The handling of promisor-remote protocol capability has been updated to allow the other side to add to the list of promisor remotes via the 'promisor.acceptFromServerURL' configuration variable.
-
The 'ort' merge backend has been hardened against corrupt trees by ensuring it aborts under appropriate error conditions.
-
The
fetch.followRemoteHEADconfiguration variable has been added to provide a default for the per-remoteremote.<name>.followRemoteHEADsetting. -
"git log --follow" has been updated to better handle non-linear history, in which the path being tracked gets renamed differently in multiple history lines.
-
The "git repo info" command has been taught new keys to output both absolute and relative paths for "gitdir" and "commondir", supported by a new path-formatting helper extracted from "git rev-parse".
-
When 'git push origin/main' or 'git branch origin main' is run, the command is now recognized as a potential typo, and advice has been added to offer a typo fix.
-
The 'git refs' toolbox has been extended with new 'create', 'delete', 'update', and 'rename' subcommands to create, delete, update, and rename references, respectively.
-
The experimental 'git history' command has been taught a new 'drop' subcommand to remove a commit, with its descendants replayed onto its parent.
-
The alignment of commit object name abbreviations in 'git blame' output has been optimized to reserve a column for marks (caret, question mark, or asterisk) only when such marks are actually shown.
-
Option parsing with 'git rev-parse --parseopt' and in most 'git' subcommands has been updated to exit with 0 (instead of 129) when the help option ('-h' or '--help') is requested directly by the user, aligning with standard Unix convention.
-
The '[includeIf "condition"]' conditional inclusion facility for configuration files has been taught to use the location of the worktree in its condition.
-
The usage string and SYNOPSIS for 'git fast-export' have been standardized to make them consistent with each other and with other commands.
-
'git log --graph' has been modified to visually distinguish parentless 'root' commits (and commits that become roots due to history simplification) by indenting them, preventing them from appearing falsely related to unrelated commits rendered immediately above them.
-
Userdiff patterns for Swift have been added, with support for Swift-specific constructs such as attributes, modifiers, failable initializers, and generics.
-
Configuration file locking has been updated to retry for a short period, avoiding failures when multiple processes attempt to update the configuration simultaneously.
-
The 'remote-object-info' command has been added to 'git cat-file --batch-command', allowing clients to request object metadata (currently size) from a remote server via protocol v2 without downloading the entire object. Format placeholders are dynamically filtered on the client based on server-advertised capabilities, returning empty strings for inapplicable or unsupported fields.
-
'git branch -d' has been taught to report when a branch cannot be deleted because it is being used in an active bisect run.
-
'git mv' has been updated to check for a missing destination leading directory during the checking phase, allowing 'git mv -n' to report the failure. The error message when the rename(2) syscall fails has also been improved to name both the source and the destination.
-
'git add' has been taught a new '--resolved' option to stage conflict-resolved paths, while leaving unrelated local changes unstaged. It scans the unmerged paths for leftover conflict markers and aborts if any are found.
-
The known limitations of the ref format migration in 'git refs' have been moved to be displayed as a warning admonition directly under the description of the 'migrate' subcommand, improving visibility. A reference to 'git-maintenance' has also been corrected to use the 'linkgit' macro.
-
The 'git bisect' command has been taught a '--reset-when-found[=]' option that tells the command to automatically run 'git bisect reset' to jump back to the original state or to the found culprit.
-
The 'git branch' command has been taught the '--delete-merged' option to remove local branches that are already merged into their tracked remote-tracking branches.
-
The 'remote-object-info' command for 'git cat-file --batch-command' has been extended to support the '%(objecttype)' placeholder.
-
The usage string of 'git fast-import' has been updated to use the parse_options() API for displaying help, and its SYNOPSIS in the documentation has been standardized to match.
-
The error message given by 'git send-email' when a message file is missing a 'Subject:' header has been clarified, and the error string is now terminated with a newline so that Perl avoids appending its internal source location data.
-
The '--shallow-file' option of 'git' command requires a value, but the code did not check the presence of a value and instead segfaulted without one, which has been corrected.
-
'git repack' has been taught '--drop-filtered' to delete local promisor blobs exceeding a limit (currently 'blob:limit=') in partial clones, reclaiming space. Guards prevent running during other operations or if referenced by the index.
-
The documentation for 'git format-rev' has been updated to use the [synopsis] block definition on code blocks to properly highlight placeholders, and a quoting inconsistency in the running text has been fixed.
-
The DWIM logic in 'git worktree add' sometimes tried to infer a remote-tracking branch when an explicit '-b' or '-B' option was given to create a new branch, causing the explicit branch name to be ignored, which has been corrected.
-
The command line completion (in contrib/) has been taught to handle the experimental 'git history' command.
-
'git checkout' and 'git worktree add' makes guesses based on a name of a remote-tracking branch, but does not give an error when such a remote-tracking branch cannot be uniquely identified, which has been corrected.
-
The 'git replay' command has been taught the '--linearize' option to drop merge commits and linearize the replayed history, mimicking 'git rebase --no-rebase-merges'.
-
The documentation for 'git cherry-pick' has been updated to clarify that the '--no-commit' option intentionally skips setting the 'CHERRY_PICK_HEAD' ref. A test has also been added to ensure this behavior holds even when the operation stops for conflicts.
-
The 'git imap-send' command has been taught to take the '--draft' option to mark uploaded messages as drafts, which helps some email clients render them properly for editing and sending.
-
The git rev-list command has been augmented with a '--missing-only' option that filters the output to only show missing objects, stripping the leading '?' character and suppressing present objects, which is useful when used in combination with '--missing=print' or '--missing=print-info'.
Performance, Internal Implementation, Development Support etc.
-
The refactoring of 'setup.c' has been continued to drop remaining global state (
git_work_tree_cfg,is_bare_repository_cfg), updatingis_bare_repository()to no longer implicitly rely onthe_repository. -
Project-specific configuration for b4 has been introduced, and the documentation has been updated to recommend using it as a streamlined method for submitting patches.
-
The default format path of git cat-file --batch has been optimized to use strbuf_add_oid_hex() and strbuf_add_uint() instead of strbuf_addf(), yielding a noticeable speedup.
-
Commands that list branches and tags (like git branch and git tag) have been optimized to pass the namespace prefix when initializing their ref iterator, avoiding a loose-ref scaling regression in repositories with many unrelated loose references.
-
The packed object source has been refactored into a proper struct odb_source.
-
The global configuration variables protect_hfs and protect_ntfs have been migrated into struct repo_config_values to tie them to per-repository configuration state.
-
The trailer sections in SubmittingPatches have been updated to encourage use of standard trailers.
-
The documentation in SubmittingPatches has been updated to clarify how patch contributors should respond to design and viability critiques, and how the resolution of such critiques should be recorded in the final commit messages.
-
The pack-objects command has been updated to support reachability bitmaps and delta-islands concurrently with the
--path-walkoption, allowing faster packaging by falling back to path-walk when bitmaps cannot fully satisfy the request. -
Documentation on community contribution guidelines has been updated to encourage replying to review comments before rerolling, and to advise a default limit of at most one reroll per day to give reviewers across different time zones enough time to participate.
-
The lazy priority queue optimization pattern (deferring actual removal in 'prio_queue_get()' to allow get+put fusion) has been folded directly into 'prio_queue' itself, speeding up commit traversal workflows and simplifying callers.
-
The 'reprepare()' callback for object database sources has been generalized into a 'prepare()' callback with an optional flush cache flag, and a new 'odb_prepare()' wrapper has been introduced to allow pre-opening object database sources.
-
The 'whence' field in 'struct object_info' has been removed. The backend-specific object information retrieval has been refactored into an opt-in 'struct object_info_source' structure.
-
A racy build failure under Meson has been corrected by ensuring that the generated header file 'hook-list.h' is built before compiling files in 'builtin_sources' that depend on it.
-
The repository discovery and repository configuration phases, which were previously intertwined in 'setup.c', have been split. Repository discovery has been updated to populate a 'struct repo_discovery' without modifying the repository state, which is then taken by repository configuration to initialize the repository, paving the way for clean unification of repository configuration.
-
The 'SubmittingPatches' document has been updated to explicitly describe the expectation for contributors to retract or abandon their patch series when they are no longer pursuing it.
-
The contributor guide has been updated to advise new contributors to trim irrelevant quoted text when replying to review comments, matching the existing advice given to reviewers.
-
The build system has been updated to support building universal macOS binaries when 'Rust' is enabled, by compiling separate static archives for each target triple listed in 'RUST_TARGETS' and combining them using the macOS 'lipo' tool. The 'git-credential-osxkeychain' helper has been updated to link against '$(RUST_LIB)' when 'Rust' is enabled.
-
The test suite has been updated to use the 'test_grep' helper instead of bare 'grep' for test assertions, allowing file contents to be printed on failure for easier debugging. A new 'greplint' linter has been introduced to detect and prevent new bare 'grep' assertions from …