I encountered same problem 4 days ago and what I have done is I opened my online repo in git site and went into repo settings and clicked on branches option. I changed the default branch from main to master and i later deleted the main branch as it was empty. tell me if this works for you.