Pushing an existing folder to an empty project

The instructions for pushing an existing folder to an empty project used to end with:

git push -u origin master

Now it ends with:

git push -u origin main

which doesn’t work. I get the error:

error: src refspec main does not match any.
error: failed to push some refs to 'git@gitlab.com:xxx/yyy.git'

If we are using the main branch, shouldn’t the instructions now end with:

git branch -M main
git push -u origin main