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

Re: Reference a submodule branch instead of a commit

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 4, 2016, 17:31 UTC
Message-ID
<xmqqshscuilh.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kZWtAU6YG4Qz9_Gwk2db5L2kPCCKrN+64hMYDovRjiLRw@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 20 quoted lines
>>
>> We already have options to support these kinds of workflows. Look at the
>> option '--remote' for 'git submodule update'.
>>
>> You then only have to commit the submodule if you do not want to see it
>> as dirty locally, but you will always get the tip of a remote tracking
>> branch when updating.
>
> I wonder if we could make that convenient for users by not tracking
> the submodule,
> i.e.
> * we have the information in the .gitmodules file
> * the path itself is in the .gitignore
> * no tree entry
>
> Then you can update to the remote latest branch, without Git reporting
> a dirty submodule locally, in fact it reports nothing for the submodule.
>
> It sounds like a hack, but maybe it's worth looking into that when
> people want to see that workflow.
It IS a hack.  

But if you do not touch .git<anything> file and instead say "clone this other project at that path yourself" in README, that would probably be sufficient.

Previous: Stefan BellerNext: Junio C Hamano
Message 5 of 9 in “Reference a submodule branch instead of a commit”
  1. Jeremy MortonOct 3, 2016
  2. Junio C HamanoOct 3, 2016
  3. Heiko VoigtOct 4, 2016
  4. Stefan BellerOct 4, 2016
  5. Junio C HamanoOct 4, 2016
  6. Junio C HamanoOct 4, 2016
  7. Heiko VoigtOct 5, 2016
  8. Junio C HamanoOct 5, 2016
  9. Heiko VoigtOct 5, 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.