I have been trying to push my local repo changes to github from command line. I have been away from git for a while now so I don't remember a few things. For the past hour I have been trying to push the repo without creating a remote repo on Github.com. As far as I remember, git push origin master/ git push is enough to push the local changes and if necessary create a repo on the remote server. However git push wouldn't let me push and automatically create the repo.
So to save time, I created remote repo on github.com and add the remote repo url using
git remote add origin https://mygithubrepoUrl.com
and it worked.
Is it necessary to create remote repo on Github and then add this url from command line to push changes? Can't Git automatically create repo and push changes?
origin
locally is the normal workflow.