How Core Git Developers Configure Git
Interesting discussion of git config options that the git core developers favor and that are not (yet) defaults. There are some nice suggestions. For example, I didn’t know that
git config --global push.autoSetupRemote true
existed. If you haven’t defined an upstream for a branch yet, git will automatically set it for you. So you don’t have to run
git push --set-upstream origin my-branch-name
anymore.
Some other options I adopted from this post:
# sort branches by last committed date
$ git config --global branch.sort -committerdate
# sort tags by tag-number not alphabetically
$ git config --global tag.sort version:refname
# better diff algorithm than the default myers
$ git config --global diff.algorithm histogram
# color moved code differently than added code in diffs
$ git config --global diff.colorMoved plain
# push branch to same-named remote
$ git config --global push.default simple
# attempt to autocorrect misspelled git commands in the cli
$ git config --global help.autocorrect prompt
# add the diff to the commit message draft
$ git config --global commit.verbose true
# 3-way-diffing
$ git config --global merge.conflictstyle zdiff3