I had the same problem but this command resolved it.
Replace:
git push -u origin master
with following command:
git push -u origin main
or
git push -f origin main
I had the same problem but this command resolved it.
Replace:
git push -u origin master
with following command:
git push -u origin main
or
git push -f origin main