I have opened a Git repository with readme file in Github, and then use below to push local code to this repository
git push origin master
It shows two branchs: main and master, but with git branch, it only shows main branch
$ git branch
* main
As main branch is empty, I use below to force the commit to main
git push --force origin main
Now there are two same branches: main and master in the repository, but still with git branch, only show *main.
When I clicked the master, it shows:
This branch is even with main.
I use below to delete master, but the error as below:
$ git push main --delete origin/master
fatal: 'main' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
What should I do now to delete one of them?
And why the main not replaced by the master?
Later should I use git push origin main instead of master to push changes?
Thanks.