The command to change the branch name is like below, use "-m" flag to modify the branch name.
git branch -m master main
Now the branch name will be called "main" and you can push it to the online repository.
git push --set-upstream origin main
Learn how to rename the master branch of your newly created repository to main.
Created on Jun 27, 2021
•108 views
git branch -m master main
git push --set-upstream origin main
If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️
Load comments for How to Rename the master branch to main in Git
Collection of Tailwind CSS components for everyone to use. Browse all of the components that are right for your project.
View Components1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago