A remote is just a word: a name to use to identify some other Git repository somewhere.
The string origin
is the default name of the (singular) remote that git clone
puts in automatically, when you clone from some other ("origin"-al) Git repository. You can choose some other name, and/or add more remotes. Each remote has, at the least, a URL, which is where the other repository is to be found.
For git push
, the third word—adjust this number if needed, if you add various flags; in this case you added -u
so now it's the fourth word—is normally the name of some remote.
The remaining words are all refspecs, which can be summarized (though not 100% accurately ... in fact, less than 50% accurately, depending on how you count :-) ) as a pair of branch names separated by a colon.
If you write just one branch name like master
, Git takes that to mean "use (part of) the upstream if one is set, otherwise use the same name after the colon." Usually the upstream, if set, has the same basic name, so master
usually winds up meaning master:master
. Git sends them—the Git at the remote's URL—commits found on your branch (the name on the left), and then asks them to set their branch (the name on the right) to the same tip commit you just pushed for that branch.
If you don't put in any refspecs, Git's default depends on your Git version. Since Git version 2.0, the default is to push your current branch to a branch of the same name on the remote.
The -u
flag tells git push
that, if the push succeeds, it should set the upstream for the branch you just pushed.
The upstream of a branch comes in two parts: the name of a remote, and the name of a branch on that remote. Since you gave git push
both items—the name of the remote was origin
, and the branch was the second (post-colon) master
from the implied master:master
from master
—this will, if it succeeds, set the upstream for master
to origin/master
.
(Edit: you might, quite legitimately, wonder where the /
came from in the upstream setting of origin/master
. That's partly a historical artifact. Unfortunately, it leads to huge amounts of confusion. For now, just keep in mind that remote, branch, and remote-tracking branch are all different things in Git. They're all related in various ways, but it's important to remember that they are not the same, and the terms have very specific meanings. The word track is also overloaded. The new term upstream is better, but not all descriptions use it.)