Git

Generate key

ssh-keygen -q -a 64 -b 4096 -t ed25519 -C mijndert@mijndertstuij.nl -f ~/.ssh/ed25519

Set default branch name

git config --global init.defaultBranch main

Sync fork

git remote -v
git remove add upstream <url>
git fetch upstream
git checkout main
git merge upstream/main

New repo

git init
touch README.md
git ca
git remote add origin <url>
git push -u origin main

Change branch name to main

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

Git send-email on Mac

brew install cpanm
cpanm --sudo Net::SMTP::SSL

.gitconfig

[sendemail]
  from = Your name <your-username@gmail.com>
  smtpserver = smtp.gmail.com
  smtpuser = your-name@gmail.com
  smtppass = your-application-specific-password
  smtpencryption = tls
  chainreplyto = false
  smtpserverport = 587

Create patch

git format-patch --to email@mailinglist.org HEAD^

or

git send-email 0001-name-of-my-patch.patch

or

git format-patch -o outgoing HEAD~5
git send-email outgoing/*.patch
rm outgoing/*.patch
rmdir outgoing

Get branch for all sub-directories

for dir in */
  do (cd $dir && echo "$dir [$(git rev-parse --abbrev-ref HEAD)]")
done