main to master in git code example Example 1: rename branch to main $ git push -u origin main Example 2: rename branch to main $ git push origin --delete master