On Tue, 27 Aug 2013 14:26:09 +0400
Konstantin Khomoutov <flatw...@users.sourceforge.net> wrote:

> Another thing you have to understand, that these "named remote
> repositories" (which are managed by the `git remote` command) is just
> a matter of convenience which
> 1) saves you from typing full URL each time you want to access a
>    repository;
> 2) keeps "bookmarks" on the state of the branches of each named remote
>    repository when you do `git fetch` on them -- in the form of the
>    so-called "remote branches" (these "origin/master" etc).

I failed to mention that these named remote repositories ("remotes",
for short) are just snippets of configuration in your local Git
repository.  They contain an URL used to access the repository and some
other bits of relevant data.

The crucial thing about them is that the names of these remotes are
completely arbitrary and have no relation at all to the names of remote
repositories they describe.  For instance, by default, when you do
`git clone URL`, Git creates a single remote named "origin", which
predefined name usually has no resemblance with the name (URL) of the
remote repository which has been cloned; rather it signifies that this
remote is the origin of data maintained in the created local repository.

>From this follows, that:
1) When you adding a named remote, you have to give the `git remote add`
   command the URL of the repository, which necessarily includes its
   name, as understood by the remote machine ("the server").
2) The name of "the remote" you're creating with `git remote add`
   is completely arbitrary and Git makes absolutely no connection
   between it and the name of the remote repository as recorded in its
   URL.  So you're free to pick whatever name you pleases, including
   "origin", if it does not yet exist.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to