You need a recent enough version of git. If you're on ubuntu/debian, this will get the most recent stable version.
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
Note: If you can't install these on a vanilla system (EG: a clean docker container) it's probably because you need the following packages installed first:
- software-properties-common
- This is for the
add-apt-repository
command- gnupg2
- This is for the more modern
gpg
command thatadd-apt-repository
will call on your behalf to install Git's trusted GPG repo key
git config --global init.defaultBranch main
git branch -m master main
git push origin :master main
git branch --set-upstream-to=origin/main main