On Tue, 15 Jan 2013 04:56:31 -0800 (PST)
Floriano Fauzzi <fauzzi.flori...@gmail.com> wrote:

> >> I want to know what is the file where, Git portable or Git stand
> >> alone software, store the mapping between the clone repository
> >> ( on pc ) and the web repository.
> >> I need this information because I know that clone repository could
> >> have a different name compared to web repository.
> >> Thanks for the answers.
> >
> > A git repository has zero or more remotes. These are other git 
> > repositories that contain more or less the same contents as you
> > have locally.
> >
> > To see which remotes you currently have configured, use:
> >
> > git remote -v
> >
> > To see more details about a given remote, for example one called
> > "origin" (which is the default name for the remote when you create
> > the local repo by cloning it from the remote one), do:
> >
> > git remote show origin
> thanks for the answer. I'm sorry, I didnt explain my question
> clearly. I try to clarify it by this scenario:
> "Paul has a repository on GitHub called *rep1 *with some files. On
> his pc, Paul clones it into the local repo called *rep2 *and stored,
> say, in C:\ "
> Now the question is:
> How does git know that the local repo stored in "C:\rep2" is mapped
> on the remote rep1 (so that, when I push any local change I've
> commited, they are sent to the right origin)?

Strictly speaking, Git does not know that.  In theory, you are able to
push any line of history from any local repository to any remote
repository you have push access to.  And you're able to fetch anything
into your local repository from any remote repo you have pull access to.
As should be clear now, Git does not "tie" a local repository to any
remote repository.

Instead, Git has the concept of "named remotes" to help you work with
remote repositories, and the so-called "remote branches" which mirror
states of remote repositories.

> Is this piece of info stored in a file? I mean, the* remote -v
> *command you wrote about, how does it retrieves the info it then
> displays?

This information is stored in the repository-local configuration file
which is ".git/config".


Reply via email to