rOpenSci | Don't Lose your HEAD over Default Branches

Read on for a little trick to always get the default branch…

While git has no “default” branch, online code platforms such as GitHub need to define a default for the branch that someone sees when they look at code online. While the community standard for the default branch is now becoming main instead of master, and while the switch for any repo is rather easy and is well supported by usethis, for a while (forever) there will still be repos with different default branches in the wild. Especially as nothing prevents you from using any other name for the default branch (although this could trip up collaborators).


This is a companion discussion topic for the original entry at https://ropensci.org/blog/2022/04/29/don-t-lose-your-head-over-default-branches/
1 Like