git set default branch code example
Example 1: git create new default branch
git branch -m master main # renames "master" to "main"
git push -u origin main # push new branch
Example 2: change git default branch
git config --global init.defaultBranch <defaultBranchName>
Example 3: Change default branch on git
git branch -m deploy prod
git fetch origin
git branch -u origin/prod prod
git remote set-head origin -a