Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

[New to git]git push origin master created new master branch. (default-main in repo)

Writer Andrew Mclaughlin
git push origin master

So I tried git push origin master and it has created a new branch master. Turns out, my main branch is main while the past repos that i tried had master as main branch. How do I solve this? How can I merge these branches or make master my default branch?

4

1 Answer

If you want to rename a branch, use the command:
git branch -M [NAME_BRANCH]

so in your case:
git branch -M master
as soon as you have renamed the branch 'master', you can continue as if nothing had happened

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy