0

I have some aliases for my git work, like git comp = !git checkout master && git pull.

But recently I have come over some git repositories where the "master" branch is called "main". And since that is also starting to be the new paradigm it causes me some headache since I still work with older repos with "master" branch.

How can I modify this alias (and other in general) to work with all naming versions? Or is there maybe some good way to refer to the "main" branch without using its name?

Tomas B
  • 121
  • 2
  • 6
  • 2
    Depending on your use-case, maybe one of these solutions can help? https://stackoverflow.com/questions/28666357/how-to-get-default-git-branch – Bast Feb 15 '23 at 10:04

0 Answers0