What is Origin?

Goals

  • Learn about naming remote repositories.

Execute:

  1. git remote

Output:

  1. $ git remote
  2. origin

We see that the cloned repository knows about a remote repository named origin. Let’s see if we can get more information about origin:

Execute:

  1. git remote show origin

Output:

  1. $ git remote show origin
  2. warning: more than one branch.master.remote
  3. * remote origin
  4. Fetch URL: /Users/jim/Downloads/git_tutorial/work/hello
  5. Push URL: /Users/jim/Downloads/git_tutorial/work/hello
  6. HEAD branch: master
  7. Remote branches:
  8. greet tracked
  9. master tracked
  10. Local branch configured for 'git pull':
  11. master merges with remote master
  12. and with remote master
  13. Local ref configured for 'git push':
  14. master pushes to master (up to date)

Now we see that the remote repository “origin” is simply the original hello repository. Remote repositories typically live on a separate machine, possibly a centralized server. As we can see here, however, they can just as well point to a repository on the same machine. There is nothing particularly special about the name “origin”, however the convention is to use the name “origin” for the primary centralized repository (if there is one).