git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: More help with "pull" please

From
Tomas Carnecky <tom@dbservice.com>
Date
Apr 2, 2009, 15:18 UTC
Message-ID
<1E580393-D051-4259-B4DE-CFFC9082C87A@dbservice.com>
In-Reply-To
<450196A1AAAE4B42A00A8B27A59278E70A7D4FF7@EXCHANGE.trad.tradestation.com>
On Apr 2, 2009, at 4:45 PM, John Dlugosz wrote:
Show 5 quoted lines
>> If your repository is using .git/remotes/origin to name the "origin"
>
> I don't have a directory under .git called remotes.  A new repository
> made using clone describes origin in the config file.  Is that an old
> way of doing things?

Yep. Earlier git versions used one config file per remote. Newer git versions use the .git/config file.

Show 13 quoted lines
>> remote, they are still honored.  But you are correct to point out  
>> that
>> branch.<name>.remote and with the remote.<name>.* variables in
>> .git/config
>> are used to control these more recent features.  So in that sense the
>> documentation is still correct.
>
> A related question:  is the name "origin" hard-coded as the default,  
> or
> does each repository remember specifically which is the upstream
> repository regardless of what you named it?  From what I see in the
> config file, it would have to be per-branch.  I suppose in other cases
> it's implicit in where the label was found under remotes.

'origin' is the default name for the remote you cloned from. But there is nothing special to it other than being a default name used throughout git. You can manually add remotes under a different name if you like.

$ git clone $url ./xyz
is roughly the same as:

$ mkdir ./xyz && cd ./xyz $ git init $ git remote add origin $url $ git fetch origin $ git checkout -b master origin/master

tom
Previous: John Dlugosz
Message 8 of 8 in “More help with "pull" please”
  1. John DlugoszApr 1, 2009
  2. Tomas CarneckyApr 1, 2009
  3. John DlugoszApr 1, 2009
  4. Tomas CarneckyApr 1, 2009
  5. John DlugoszApr 1, 2009
  6. Junio C HamanoApr 2, 2009
  7. John DlugoszApr 2, 2009
  8. Tomas CarneckyApr 2, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.