April 29, 2021


git python tools

Main not Master

I keep forgetting to choose the more inclusive name main for a default for new git repositories. Thanks to the handy hint when using git init these days, here is a one-liner to change this on an installation-wide basis:

1
git config --global init.defaultBranch main

Let Black do the work of formatting Python code

Follow instructions here:

1
pip3 install black

Since I’m using asdf for my Python installation, I’m actually defining that in a $HOME/.default-python-packages file so that it’s installed by default in every Python. But regardless, you can then tell the Python extension in VS Code to use black as it’s code formatter.

Change format settings in VS Code

See Also