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

serving git with both "git:" and "http:" and submodules

From
Boaz Harrosh <bharrosh@panasas.com>
Date
Jul 14, 2010, 15:29 UTC
Message-ID
<4C3DD7EF.6010805@panasas.com>

I have a public tree that I maintain for users. The tree is consisted of a main-tree and a submodule tree which is also served from the same server.

The main tree: git://my-domain.org/my-tree/.git The sub-tree: git://my-domain.org/my-tree/sub/.git

in my .gitmodule I have the usual
[submodule "sub"]
        url = git://my-domain.org/my-tree/sub/.git
So smart people using git will just do:
1. $ git clone git://my-domain.org/my-tree/.git
2. $ git submodule init
3. $ git submodule update
And all is well... But smart ass corporate people would not use "git:"
protocol because of fire-walls and for them I have a dumb "http:" export
as:
1. $ git clone http://my-domain.org/trees/my-tree/.git
With them, step 3 above will not work. My current instructions
for them is that after the step 2 "git submodule init" they should
manually edit my-tree/.git/config and change to:
[submodule "sub"]
-        url = git://my-domain.org/my-tree/sub/.git
+        url = http://my-domain.org/trees/my-tree/sub/.git
And then do step 3 to clone the sub-module.

So my question is: Can I automate this so people with "http:" clones are not forced to manually edit their config files? (Some users are just not up to it)

Thanks, (Sorry if that has been raised before. Couldn't find any.) Boaz

Next: Jonathan Nieder
Message 1 of 12 in “serving git with both "git:" and "http:" and submodules”
  1. Boaz HarroshJul 14, 2010
  2. Jonathan NiederJul 14, 2010
  3. Boaz HarroshJul 14, 2010
  4. Jonathan NiederJul 14, 2010
  5. Brad KingJul 15, 2010
  6. Peter KreftingJul 15, 2010
  7. gitmodules.5: url can be a relative pathJonathan Nieder, Jul 15, 2010
  8. Documentation: add submodule.* to the big configuration variable listJonathan Nieder, Jul 15, 2010
  9. Johan HerlandJul 15, 2010
  10. Jonathan NiederJul 15, 2010
  11. Johan HerlandJul 15, 2010
  12. Boaz HarroshJul 15, 2010

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.