Skip to content

Instantly share code, notes, and snippets.

@iedemam
Created March 28, 2014 10:50
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • 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/git@github.com:/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??????????????

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