Re: problems serving non-bare repos with submodules over http
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 20, 2016, 19:51 UTC
- Message-ID
- <xmqqh9ewukhw.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79kYS-F1yKpNP7jmhTiZT1R_pucUBBTCbmHKZz6Xd6dy8EA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 18 quoted lines
>> 1. After cloning >> >> git clone http://localhost:8080/.git >> >> I cannot 'submodule update' the sub1 in the clone since its url after >> 'submodule init' would be http://localhost:8080/.git/sub1 . If I manually fix >> it up -- it seems to proceed normally since in original repository I have >> sub1/.git/ directory and not the "gitlink" for that submodule. > > So the expected URL would be http://localhost:8080/sub1/.git ? > > I thought you could leave out the .git prefix, i.e. you can type > > git clone http://localhost:8080 > > and Git will recognize the missing .git and try that as well. The relative URL > would then be constructed as http://localhost:8080/sub1, which will use the > same mechanism to find the missing .git ending.
I may be missing the subtleties, but if you are serving others from a non-bare repository with submodules, I do not think you would want to expose the in-tree version of the submodule in the first place.
These $submodule/.git files point via "gitdir:" to their real repository location, don't they? And I would think that they are what you would want to expose to the outside world. Your in-tree submodules may come and go as you checkout different branches in your working tree, but these copies at their real locations will stay.