What's the meaning of 'origin' in 'git push origin master'

git has a concept of "remotes" - these are like easy nicknames for a repository, so you don't have to use its full URL every time you want to refer to another repository.

origin is just a remote like any other, but you see it very frequently since when you clone a repository for the first time, git clone will by default set up a remote called origin to refer to the URL that you cloned from.

If you do git remote -v that will show you all the remotes you have set up in your local repository, and the URLs that they refer to. (You'll see that it's a bit more complex than I said above, in that a remote can refer to a different URL for pushing and fetching, but you probably don't need to worry about that. :))


origin is the default name of the remote git repository you cloned from. Have a look at .git/refs/remotes/origin/* and .git/config within your sources to see how git knows about it.


The origin is where you got the code from origin-ally.