Today is great news: the release of the distributed version control system Git 2.29.0 has appeared in the public domain.

The new release contains 627 changes at once, which were made by 89 developers. Now let’s take a look at the main changes.

  • Let’s start with the experimental possibility of using the SHA-256 hashing algorithm instead of the compromised SHA-1 when writing objects to the repository. The hash is now generated from the content of each object in Git and is its unique identifier. Any attempt to change the data or headers of an object will change the identifier. However, SHA-1 was compromised, so it was decided to take Git to a new level of protection. It was originally planned to use SHA3-256, but in the end, the developers used SHA2-256, since SHA2 is already used in Git for digital signatures. It was a sensible decision not to add a new algorithm, because if at least one of them was compromised, it would lead to security problems. The more elements in the system, the higher the likelihood that something will go wrong – the logic is clear.
  • Now Git has added the ability to include a new object format when creating a repository.

You can only choose between SHA-1 and SHA-256, there is no possibility to combine different hashes in one repository.

  • The git fetches and git push commands now support exclusionary link specifications that extend the rules for link matching between branches in the local and external repositories. This feature will be useful in situations where you need to not only select but also exclude some branches from the mapping. So, when you need to check out all the “refs/heads / *” branches, except for one “refs/heads / ref-to-exclude”, before you had to specify the complete list using this script:
  • Now there is an exception operator “^”. Expressions with this operator accept templates, but cannot refer to object identifiers. A command using the new operator might look like this:

In addition, you can use exclusions in the settings:

  • The “git shortlog” now has the ability to group commits by the content of additional fields, “Reviewed-by:” and “Coauthored-by:”, and not just by author or committer. So if you need to display a list of the most actively reviewing developers, then you need a command:
  • Multiple –group statements can be specified at startup and use the –format option. So to keep track of co-authors or contributors, you now need to specify this:
  • If a conflict occurs during a git merge operation, the header of the commit message is now bracketed to explicitly separate the data from the commit from the Git diagnostic messages.
  • The developers brought back the second version of the Git communication protocol, which was disabled in the 2.27 release. Thus, a bug that led to stability problems has been fixed.
  • The “–first-parent” option has been added to the git bisect command, which is used to detect a revision, to change the selection of commits between the known working revision and the revision in which the problem occurred.