# Cloning of a new (public github) submodule fails

**URL:** <https://discuss.circleci.com/t/cloning-of-a-new-public-github-submodule-fails/26592>\
**Category:** Build Environment\
**Tags:** github\
**Created:** [November 18, 2018, 10:15am UTC](https://discuss.circleci.com/t/cloning-of-a-new-public-github-submodule-fails/26592 "2018-11-18T10:15:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bstaletic](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@bstaletic](https://discuss.circleci.com/u/bstaletic)\
**Post date:** [November 18, 2018, 10:15am UTC](https://discuss.circleci.com/t/cloning-of-a-new-public-github-submodule-fails/26592/1 "2018-11-18T10:15:27Z")

</div>

Hello,

I’ve been using CircleCI for a while, but only recently have I had the need to change my project’s submodules. However, cloning the submodules fails with `ERROR: Repository not found.` All three submodules are publicly available github repositories.  
I do have “an SSH user key” added to my repo’s CircleCI configuration, as well as the deploy key.

What’s strange is that I actually added 4 submodules, and only one of the four submodules can be cloned. That one is owned by me. The other three submodules are also submodules of another submodule, but, for whatever reason, what doesn’t work as a submodule for me, works as a submodule of my submodule.

[CircleCI build encountering the error](https://circleci.com/gh/bstaletic/YouCompleteMe/19)

What’s frustrating is that this isn’t the only case where I need to change submodules.

---

<div class="post-metadata">

**Author:** ![bstaletic](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@bstaletic](https://discuss.circleci.com/u/bstaletic)\
**Post date:** [November 18, 2018, 1:10pm UTC](https://discuss.circleci.com/t/cloning-of-a-new-public-github-submodule-fails/26592/2 "2018-11-18T13:10:47Z")

</div>

Turns out CircleCI doesn’t like trailing slashes in `.gitmodules`.

URL that didn’t work: `https://github.com/slezica/python-frozendict/`  
URL that did work: `https://github.com/slezica/python-frozendict`

---

<div class="post-metadata">

**Author:** ![puremourning](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/puremourning/32/19763_2.png) [@puremourning](https://discuss.circleci.com/u/puremourning)\
**Post date:** [November 18, 2018, 1:17pm UTC](https://discuss.circleci.com/t/cloning-of-a-new-public-github-submodule-fails/26592/3 "2018-11-18T13:17:39Z")

</div>

For the record, the reason is that CIrcleCI adds the following .gitconfig:

```auto
[url "ssh://git@github.com"]
        insteadOf = https://github.com

```

Cloning via ssh does not work with a trailing / in the address.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [February 16, 2019, 1:19pm UTC](https://discuss.circleci.com/t/cloning-of-a-new-public-github-submodule-fails/26592/4 "2019-02-16T13:19:02Z")

</div>

Closed on February 16, 2019, 1:19pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
