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

Re: help: the question about relative path in the objects/info/alternates

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 1, 2011, 17:44 UTC
Message-ID
<7vr555hvqf.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4E366F08.2060808@gmail.com>
Jason Wang <jason77.wang@gmail.com> writes:
> From the objects/info/alternates part of this URL
> http://www.kernel.org/pub/software/scm/git/docs/gitrepository-layout.html,
> it says it will work if alternates has relative path in it.

It does not just say "relative path", but "relative to the object database". It expresses where the "objects" directory you are borrowing from is, relative to your own "objects" directory.

For example, if you have /src/ib/{objects,refs,HEAD} as your repository that borrows from elsewhere, say /src/base/, then objects/info/alternates file in the borrowing repository should say either /src/base/objects/, or "../../base/objects".

An easy way to make sure you do not make typo is to go to your borrowing objects directory, and then let your shell completion to type your path, like this:

    $ cd /home/jason/source/incremental-bare
    $ cd objects
    $ echo ../../base-bare/objects >info/alternates

While formulating that "echo" command line, you would type ../../ <TAB> and pick base-bare, <TAB> and pick objects.

Previous: Jason WangNext: Jason Wang
Message 2 of 3 in “help: the question about relative path in the objects/info/alternates”
  1. Jason WangAug 1, 2011
  2. Junio C HamanoAug 1, 2011
  3. Jason WangAug 2, 2011

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.