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/alternatesWhile formulating that "echo" command line, you would type ../../ <TAB> and pick base-bare, <TAB> and pick objects.