I am following the instructions given here to create a Git repository. All went well until the last line:
$ git push -u origin master
Setting remote repository URL worked for me:
git remote set-url origin https://github.com/path-to-repo/MyRepo.git