Git 2.45 Source Control System Now Available

After two months of development published release of a distributed source control system Git 2.45. Git is one of the most popular, reliable and high-performance version control systems, providing flexible non-linear development tools based on branching and merging. To ensure the integrity of history and resistance to retroactive changes, implicit hashing of the entire previous history is used in each commit; it is also possible to certify individual tags and commits with digital signatures of developers. Git code distributed by licensed under GPLv2+.

Compared to the previous release, the new version included 540 changes, prepared with the participation of 96 developers, of which 35 took part in development for the first time. Basic innovations:

Advertisement

  • Added preliminary support for the “reftable” backend to efficiently store branch and tag references in the repository. The new backend uses the block storage used by the project JGit and optimized for storing a very large number of refs (traditional ref storage formats lead to significant overhead in repositories with a large number of refs due to the placement of a very large number of files in one directory in the case of storing refs in the $GIT_DIR/refs directory or the need to rewrite one large file with each update if links are stored in the file $GIT_DIR/packed_refs). The new backend is enabled by specifying the “–ref-format=reftable” option when initializing the repository (“git init –ref-format=reftable /path/to/repo”) and allows you to speed up searching, reading and writing in repositories with a large number of links.
  • Provides tools for portability between SHA-1 and SHA-256 hash-based object identifiers. To ensure work with SHA-1 and SHA-256 hashes in one repository in the process of gradual migration to SHA-256 hashes, a new “compatibility” object format has been proposed, which allows objects to be referenced not only by the main hash specified when initializing the repository, but also by spare hash. For example, when initializing a repository, you can select the SHA-256 format, and define the SHA-1 hash as a backup:
     git init --object-format=sha256 /path/to/repo cd /path/to/repo git config extensions.compatObjectFormat sha1
  • The “git rev-list” command now has the ability to display object IDs that are not in the local repository, even if they are not reachable in a branch or tag, which can be used to diagnose repository corruption:
     git rev-list --missing=print --all | grep '^?' ?70678e7afeacdcba1242793c3d3d28916a2fd152
  • Added new command “git reflog list” to show known reflogs and their corresponding links to tags and branches.
  • Provides the ability to define alternative prefixes for the “git diff” output, displayed before the file path and indicating the state before and after a particular version of the file (the default prefixes are “a/” and “b/”). To set your own prefixes, new parameters diff.srcPrefix and diff.dstPrefix have been added to the configuration.
  • Added core.commentString parameter to define a separator string that will be used instead of the “#” character to ignore comments in the commit message. The previously available core.commentChar setting has been adapted to support multi-byte characters as a comment delimiter (previously only ASCII characters were supported).
  • The “–comment” option has been added to the “git config” command, allowing you to save comments in the .gitconfig file to explain the essence of certain settings.
     git config --comment 'to show the merge base' merge.conflictStyle diff3 tail -n 2 .git/config (merge) conflictStyle = diff3 # to show the merge base
  • Added “–empty” option to the “git cherry-pick” command to automatically remove redundant commits, similar to the “–empty” option in git-rebase and git-am.
  • The “git checkout -p” command allows the “@” symbol to be used as a synonym for the name “HEAD”.

Thanks for reading:

Advertisement