The git config Defaults Worth Overriding
Six git config one-liners worth setting: branch.sort=-committerdate, column.ui=auto, rebase.autosquash, push.autoSetupRemote, diff.algorithm=histogram and help.autocorrect. They fix defaults git keeps only for backward compatibility.
Some git config defaults are wrong for how anyone works in 2026, and git keeps them only so it doesn’t break twenty years of scripts. A handful of one-liners fix the worst of them: branches sorted by date instead of alphabet, pushes that set up their own remote, diffs from a smarter algorithm, and a typo-correcting git. Set them once with --global and forget about it.
The branch.sort tip in particular made the Hacker News front page, which is how a lot of people found out git could do it at all. The rest are from the GitButler write-up on how core git devs configure git, and I’ve verified each flag against git help config.
Sort branches by date, not the alphabet
git branch lists alphabetically by default, which tells you nothing about what you were doing yesterday.
git config --global branch.sort -committerdate
Now the branch you touched most recently is at the top. The one you branched off in March and abandoned sinks to the bottom where it belongs. This is the change I miss most on a machine that doesn’t have it.
Put lists in columns
git config --global column.ui auto
git branch, git status and git tag will lay long lists out in columns when the terminal is wide enough, instead of one item per line burning half your scrollback. Small, but it’s on every time you list anything.
Stop fighting git push on new branches
Push a brand-new branch with the defaults and git refuses, demanding git push -u origin branchname. Every time.
git config --global push.autoSetupRemote true
Now the first git push creates the matching upstream branch itself. One less rote command in the loop you run twenty times a day.
Make rebase autosquash work for you
If you write fixup commits with git commit --fixup=<hash>, an interactive rebase can reorder and squash them automatically, but only if you ask for --autosquash every time. Make it the default:
git config --global rebase.autosquash true
Then git rebase -i slots your fixup! commits next to their targets and marks them to squash, no manual reordering. It’s the other half of the small-commits workflow.
Get better diffs
Git’s default diff still uses the Myers algorithm from 1986. The histogram algorithm is smarter about moved and reordered code, and it costs you nothing:
git config --global diff.algorithm histogram
Diffs where a function moved read as a move, not as one giant deletion next to one giant addition. It changes the output only, never your files.
Let git fix your typos
git config --global help.autocorrect prompt
Type git stauts and git offers status and asks before running it. You can also set a number, where help.autocorrect 10 runs the guessed command after a one-second pause (the value is in tenths of a second). prompt is the polite version. Either beats the default, which just tells you git: 'stauts' is not a git command and gives up.
None of these change history or touch a file. They change how git talks to you, and the defaults it ships are the cautious, compatible ones, not the good ones. Copy the six lines into your global config and the tool stops getting in the way. That’s the whole pitch for auditing your git config defaults: five minutes now against a hundred tiny frictions a week you’ve stopped noticing.