I work on several projects with some having main and some master as default branch. I can't rename all the projects with one or other name because not all are managed by me. I know the .gitconfig alias system is very wide so I'm wondering if there is a way to accept both names for every command where there are involved. So far I only found this but it involves modify each individual command and using !sh -c which is not very 'pretty'. The ideal would be to also testing if both branches actually exist in the repo to avoid mistakes.
I tried adding master = main at the beginning of .gitconfig [alias] section but it don't works in either way.