References

What are Git References?

Search for: What are Git References?

Remotes are remote git servers that are used to pull or push local branches.

As there are various branches on local there seem to be branches on the server as well. They may or may not match. They may or may not track each other.

when you clone a git repository from a server into an empty directory the name "origin" refers to the remote server where it came from.


$ git remote -v
bakkdoor  https://github.com/bakkdoor/grit (fetch)
bakkdoor  https://github.com/bakkdoor/grit (push)
cho45     https://github.com/cho45/grit (fetch)
cho45     https://github.com/cho45/grit (push)
defunkt   https://github.com/defunkt/grit (fetch)
defunkt   https://github.com/defunkt/grit (push)
koke      git://github.com/koke/grit.git (fetch)
koke      git://github.com/koke/grit.git (push)
origin    [email protected]:mojombo/grit.git (fetch)
origin    [email protected]:mojombo/grit.git (push)

This lists various remote references.


$ git remote show origin
* remote origin
  Fetch URL: https://github.com/schacon/ticgit
  Push  URL: https://github.com/schacon/ticgit
  HEAD branch: master
  Remote branches:
    master                               tracked
    dev-branch                           tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)

notice how the local branches are tracked and tied to the remote branches.

Here is a good intro to working with remotes