When I run:
git push origin branchname
What exactly is the origin and why do I have to type it before the branch name?
"origin" is noting just what you nicknamed your remote repository when you ran a command like this:
$ git remote add origin [email protected]:USERNAME/REPOSITORY-NAME.git
Now your Git knows that "origin" points to that specific repository. You could have named it "github" or "repo" or whatever you wanted.