Git branch names sanitizer
npm i -g branch-safe-name
$ branch-safe-name -l -s '-' Some long string that you copy-pasted from a browser
some-long-string-that-you-copy-pasted-from-a-browser
Create an alias in your .gitconfig
[alias]
brnew = !"f() { branch-safe-name -l -s '-' $@ | xargs git checkout -b; }; f"
Use it to create new branches
git brnew Fix for the bug #1234
It will create a new fix-for-the-bug
branch for you 😎