8

I have the following .gitmodules file:

[submodule "web/blog"]
    path = web/blog
    url = git://amygdala.servebeer.com:lucky_blog.git

[submodule "web/old"]
    path = web/old
    url = git://amygdala.servebeer.com:old_lucky.git

When I clone the repo and run git submodule init && git submodule update (or git submodule init --update) I get the following error:

Cloning into web/blog...
fatal: Unable to look up  (port 9418) (Name or service not known)
Clone of 'git://amygdala.servebeer.com:lucky_blog.git' into submodule path 'web/blog' failed

I observe three things which cause some concern:

  1. The second .gitmodules entry (web/old) is cloned just fine, with no issues.
  2. There appears to be an extra space in the error message, where I think git would normally list the hostname it fails to look up (right before the port number listing in the error listed above).
  3. git clone git://amygdala.servebeer.com:lucky_blog.git works just fine.

What is wrong with this repo? Is this an error with git or did I screw something up when setting up the repo?

Edit Here's my git config for reference:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = [email protected]:luckybead.git
[branch "master"]
    remote = origin
    merge = refs/heads/master
[submodule "web/blog"]
    url = git://amygdala.servebeer.com:lucky_blog.git
[submodule "web/old"]
    url = git://amygdala.servebeer.com:old_lucky.git
3
  • Did you try to: remove the first block. Duplicate the second block, and replace old by blog in that second block? (both inverting the order, and making sure there isn't any kind of special character that might have caused the bug in the original first block)
    – VonC
    Commented Oct 5, 2011 at 3:55
  • Can you show your submodules related stuff from .git/config?
    – dmedvinsky
    Commented Oct 5, 2011 at 3:57
  • VonC: the duplication didn't seem to work. dmedvinsky: added the config for your reference.
    – Octaflop
    Commented Oct 5, 2011 at 4:19

1 Answer 1

12

You have the format of your git URLs slightly wrong - you should separate the host from the path with / rather than :. Try changing the URLs to:

git://amygdala.servebeer.com/lucky_blog.git
git://amygdala.servebeer.com/old_lucky.git

You will not only need to commit those changes to .gitmodules, but also change the config with:

$ git config submodule.web/blog.url git://amygdala.servebeer.com/lucky_blog.git
$ git config submodule.web/old.url git://amygdala.servebeer.com/old_blog.git

... and to make sure that the submodules are re-cloned, remove them and try the git submodule update again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.