I work on a bunch of different repos - many of them use master
, and many of them use main
.
I also have various shell aliases set up for git commands, e.g. gcm
for git checkout master
.
The problem is that I cannot use these aliases on repos where master
doesn't exist. It's obviously not a big deal, because I just need to type out the command manually in that case, but it's slightly annoying.
I am wondering if there's a way I can "alias" branches in git, so when I say git push origin master
it can just automatically replace that with main.