Skip to content

Instantly share code, notes, and snippets.

@iedemam
Created March 28, 2014 10:50
Show Gist options
  • Save iedemam/9830045 to your computer and use it in GitHub Desktop.
Save iedemam/9830045 to your computer and use it in GitHub Desktop.
Automatically manipulate .gitmodules so Travis CI pulls submodules from public URL instead of SSH URL.
#
# I use SSH URLs in my submodules for convenience. However, Travis CI is unable to
# clone from those URLs even though the repositories are public. To fix this, I'm
# simply manipulating the .gitmodules file with sed so it points to the public
# URLs before initializing the submodules.
#
# Hope it saves you some frustration!
#
# disable the default submodule logic
git:
submodules: false
# use sed to replace the SSH URL with the public URL, then init and update submodules
before_install:
- sed -i 's/[email protected]:/git:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
@agnat
Copy link

agnat commented Oct 4, 2016

Hope it saves you some frustration!

Indeed, Sir! It did.

@Stevendeo
Copy link

Even 6 years after, still useful. Thanks !

@mdazhar488
Copy link

mdazhar488 commented Apr 8, 2022

disable the default submodule logic

git:
submodules: false
How to disable this??????????????

@ljharb
Copy link

ljharb commented Jun 10, 2024

Still helpful for me a decade later :-) thanks! (i used https instead of git, fwiw, because i think github retired bare git URLs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment