I frequently want to do this, but can never remember how.
First I create a file on my computer, some source code, and now I want to push it to a github repo.
So I create a github repo. (On github) Click "clone" to get the URL for later.
Now I run the following commands on my local machine.
git init // make a repo, local
git add * // add files to repo
git commit -a -m "initial commit" // commit files to repo and add msg
git remote add origin (...url...) // tell git where to push
git push --set-upstream origin master // no idea what this does
git config --global user.name "...name..." // set my name so github knows what my username is
git push // does not work error:
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
Still can't "push". What am I doing wrong?