Let's assume the temporary branch is backup
.
-
Change the default branch to
backup
on GitHub:- Go to "Settings" -> "Branches" -> change the default branch to
backup
.
- Go to "Settings" -> "Branches" -> change the default branch to
-
Delete the remote
main
branch:git push origin --delete main
-
Push your local
main
branch to the remote:git push origin main
-
Change the default branch back to
main
:- Go to "Settings" -> "Branches" -> change the default branch back to
main
.
- Go to "Settings" -> "Branches" -> change the default branch back to
-
Delete the
backup
branch if it was temporary:git push origin --delete backup