I know similar questions have already been asked.
But, I believe my issue is due to a mistake I have previously made and therefore is different: let me explain.
It works for me.
git remote add origin https://github.com/repo.git git push origin master
add the repository URL to the origin in the local working directory