Git 2.40 brings editor integration, scripting fixes, and a faster core
The open source Git project has released Git 2.40, a version shaped by contributions from more than 88 developers, including 30 first-time contributors. The release focuses on making Git more convenient for developers who live in their editors, more accurate for scripters, and more efficient for the maintainers running its CI. Here are the noteworthy changes.
Editor-friendly navigation with git jump
Git has long shipped an optional tool called git jump in its contrib directory. This utility wraps commands such as git grep and funnels their output into Vim's quickfix list, letting you cycle through matches with commands like git jump grep foo. It also supports diff mode, which populates the quickfix list with the start of each changed hunk for quick pre-commit review, and merge mode, which jumps straight to conflict markers.
In Git 2.40, git jump gains Emacs support. Emacs users can feed results into their client via a command such as:
M-x grep
Consistent object sizes with --use-mailmap
Git 2.38 introduced the --use-mailmap flag to git cat-file, allowing the command to apply a repository's mailmap rules—which rewrite author name and email pairs—before printing object contents. However, the related size queries weren't updated at the time. Both git cat-file -s and the --batch-check output ignored the mailmap transformations, which produced incorrect sizes whenever a mailmap rewrite changed the length of the name or email fields.
Git 2.40 corrects this inconsistency. Running git cat-file -s or --batch-check with --use-mailmap now reports the object size as if the replacement identities had been written to the object, making these scripting tools reliable again.
Simpler attribute lookups without an index
The less-frequently-used git check-attr command tells you which gitattributes rules apply to a given path. While straightforward attributes can be read directly from a .gitattributes file, complex rule sets and multiple attribute files can make this difficult to determine by eye. The command has always handled that job, but with a catch: it required an index to be present.
Working in a bare repository previously meant painstakingly staging that repository's contents just to query attributes, using a temporary index workaround. Git 2.40 eliminates that need with a new --source=<tree-ish> option, letting you point check-attr directly at a tree to scan for .gitattributes. The same lookup that required that temporary-index dance before can now be done in one clean invocation, even in bare repositories.
Legacy scripted commands fade out
A long-running project to migrate Git's old Perl and Shell commands into native C has reached two major milestones. First, git bisect is now a fully native builtin, the culmination of work from many contributors, including Google Summer of Code and Outreachy students. Second, the legacy implementation of git add --interactive has been retired entirely.
That command originally began as a Shell script and was reimplemented as a builtin in Git 2.26, surviving behind an experimental add.interactive.useBuiltin config flag. Since that flag has defaulted to true since Git 2.37, the old scripted path is now gone for good. The payoff is most visible on platforms with high process startup costs, like Windows, where consolidating operations into a single process yields meaningful speedups.
Leaner CI for Git developers
Two CI improvements target developers working on Git itself. The project has shut off several long-running Windows-specific job definitions that had been enabled outside the git-for-windows repository, which should reduce both runtime and resource consumption per push.
Additionally, there's now control over how pushes interact with already-running CI jobs. Git's ci-config mechanism lets you add a script named skip-concurrent to a branch called ci-config in your fork. When present, Git consults the script to decide whether overlapping CI runs on the same branch should be cancelled—useful when you're pushing multiple times while developing a topic.
For a complete rundown of everything that landed in this release, consult the official release notes.



