[New to git]git push origin master created new master branch. (default-main in repo)
Andrew Mclaughlin
git push origin masterSo 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?
41 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