How to Set the Default Git Branch Name from Master to Main

Change default Git branch from master to main for new repositories and rename existing branches with simple commands and hosting updates.