Git 2.31 is now available and arrives with git maintenance

A few days ago , the release of the new version of Git 2.3 was announced , one of the most popular, reliable and high-performance version control systems, which provides flexible non-linear development tools based on branching and merging.

Compared to the previous version, 679 changes were adopted in the new version, prepared with the participation of 85 developers , 23 of whom participated in the development for the first time.

Git 2.31 Key New Features

This new version of Git 2.31 features the addition of the "git maintenance" command , which allows for periodic maintenance on systems that don't support cron . For example, with this new command, you can schedule the repository packing process to start periodically, eliminating the need to wait for the repository lock to complete when packing is performed automatically after multiple commands are executed.

Another notable change is the addition of support for maintaining a reverse index on disk (revindex) for package files. Git stores all data as objects, which are kept in separate files. To improve the efficiency of working with the repository, these objects are further organized into package files, where the information is presented as a stream of objects that follow one another.

For each package archive, an index file (.idx) is created, which allows the object identifier to be used to quickly determine the offset within the package archive where the object is stored. The reverse index (.rev) proposed in Git 2.31 aims to optimize the process of determining an object identifier from information about the object's location within a package archive.

Previously, this conversion was performed on the fly during the parsing of a package file and stored only in memory, which did not allow for the reuse of these indexes and required generating the index each time. The operation of building an index reduces to constructing an array of object position pairs and sorting them by position, which can be very time-consuming for large package files.

Furthermore, we can find that performance optimizations based on the appearance of the commit graph file format have been added , which is used to optimize access to information about commits, and new data on the number of commits generated, which can be used to speed up additional operations with commits.

Additionally, the ability to override the default branch name in new repositories (init.defaultBranch setting) was added. When accessing external repositories, Git attempts to verify the branch that HEAD points to; that is, if the external server is using the "main" branch by default, then the "git clone" operation will attempt to find "main" locally.

Other notable changes include:

  • The "–disk-use" option added to the "git rev-list" command to display a summary of the size of the objects.
  • Support for the deprecated regular expression library PCRE1 has been removed.
  • Provided the ability to forcefully prohibit the use of shortcuts, acting independently of the hashing algorithm. The prohibition is enabled by assigning the value "no" to the core.abbrev parameter.
  • The "–path-format" option has been added to the "git rev-parse" command to explicitly define the output of relative or absolute paths.
  • Bash's autocomplete scripts make it easy to add completion rules for custom "git" subcommands.
  • Added "–stdin" option to "git bundle" command to read links from standard input stream.
  • The "–left-only" and "–right-only" options have been added to the "git range-diff" command to show only one side of the compared range.
  • Added option "–skip-to = »To the« git difftool »command to resume an interrupted session from an arbitrary path.
  • The Code of Conduct (Code of Conduct), which defines the basic principles for resolving conflicts between developers, has been updated to version 2.0 (previously version 1.4 was used).

Finally, if you want to learn more about it , you can consult the following link.


Add as preferred source in Google