RSS Amplifier

staticnotes.org · Feb 25, 2025

How Core Git Developers Configure Git

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

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…

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 

link: https://blog.gitbutler.com/how-git-core-devs-configure-git/

via: https://news.ycombinator.com/item?id=43169435

Read on /feed/2025/02/how-core-git-developers-configure-git/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.