It pays to follow the release notes because some of these features are opt-in (e.g. commit graph is still optional).
The sparse checkout stuff is great but still too low-level for us to use, but it's laying the groundwork for something good.
git range-diff
Very useful to get an overview of what changed after a rebase.Or maybe not: I guess it's kinda slow and heavy on computation.
It's not at all new according to a quick grep of RelNotes, but I only recently discovered it, so it is new to me.
This makes git diff highlight reindented or moved lines differently.
I use it to get diffs similar to when you pass -w, but with a bit more context.
It takes a bit of experimenting to keep it from looking like a fruit salad, but sometimes you get interesting results.
https://git-scm.com/docs/git-diff#Documentation/git-diff.txt...
Godsend if you regularly need to work on multiple branches simultaneously.
Those confusing switches are already ingrained in my memory (or hidden away behind aliases) and now I find it more confusing that git is recommending new and different commands to do things that I've been doing a fixed way for years.
`git restore <file>` instead of `git checkout -- <file>`is another one.
git restore and git switch basically tries to seperate the functionality.
i.e. from: "git-checkout - Switch branches or restore working tree files"
to
- "git-switch - Switch branches"
- "git-restore - Restore working tree files"
tbf I found it really stupid from the beginning that it tries two things at once.
It speeds up git status on large codebases
https://github.com/git/git/blob/master/templates/hooks--fsmo...
It's not just better name for doing "git checkout -- path". "git checkout" has this stupid behavior of restoring files to worktree and index. "git restore" by default doesn't touch index (I wrote SO answer that explains this a bit more: https://stackoverflow.com/a/60855504/350384)
there is also "git switch" but I just kept using "git checkout" because there is nothing "git switch" can do that "git checkout" can (it's just a shorter name but I had aliased "checkout" to "ch" anyway, as many people do)
I don't follow each Git release, but I also didn't notice a great productivity enhancement for a long time. Sure it is a sign of a mature project, but I'd like to know:
What's the somewhat recent Git feature that you really improved your productivity?