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

Re: Submodule's .git file contains absolute path when created using 'git clone --recursive'

From
Junio C Hamano <gitster@pobox.com>
Date
May 5, 2016, 17:19 UTC
Message-ID
<xmqq1t5gctiv.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<loom.20160505T140253-275@post.gmane.org>
Loet Avramson <loet@forter.com> writes:
Show 16 quoted lines
> According to git-clone man page - running 'git clone --recursive' "...is 
> equivalent to running 'git submodule update --init --recursive' immediately 
> after the clone is finished...", though I found a little difference between 
> the two regarding the submodule's .git file:
>
> 1. Running 'git clone' and 'git submodule update --init --recursive' 
> separately will create the .git file in each submodule containing a relative 
> path to the superproject's .git directory as expected.
>
> 2. Running 'git clone --recursive' will create the .git file containing an 
> *absolute* path to the superproject's .git directory. (as it was expected 
> using git versions 1.7.8 - 1.7.10 as far as I understand)
>
> Not sure if that's a bug but it got stuff behaving really weird in a specific 
> usecase on one of our environments. It would be highly appreciated to update 
> the docs at least.

If the documentation already says "equivalent" and does not say "identical", I am not sure if there is anything to update.

In any case, I thought some people are already working to make the result consistently use relative paths (or was it absolute?), so this may soon become a non-issue.

Previous: Loet AvramsonNext: Stefan Beller
Message 2 of 7 in “Submodule's .git file contains absolute path when created using 'git clone --recursive'”
  1. Loet AvramsonMay 5, 2016
  2. Junio C HamanoMay 5, 2016
  3. Stefan BellerMay 5, 2016
  4. Loet AvramsonMay 5, 2016
  5. Stefan BellerMay 5, 2016
  6. Ricardo Sánchez-SáezJul 12, 2016
  7. Stefan BellerJul 12, 2016

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.