References

satya - 4/12/2018, 4:10:35 PM

What are Git References?

What are Git References?

Search for: What are Git References?

satya - 4/12/2018, 4:11:09 PM

These seem to be related to remotes

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

satya - 4/12/2018, 4:12:13 PM

Remote branches vs 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.

satya - 4/12/2018, 4:13:43 PM

By default origin is a name given to the cloned server

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.

satya - 4/12/2018, 4:14:50 PM

Here is an example from ProGit book


$ 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    git@github.com:mojombo/grit.git (fetch)
origin    git@github.com:mojombo/grit.git (push)

This lists various remote references.

satya - 4/12/2018, 4:16:22 PM

Here is an example how branches on a remote can be seen


$ 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.

satya - 4/16/2018, 10:46:55 AM

Here is a good intro to working with remotes

Here is a good intro to working with remotes