# Travis CI is not updating git submodule

**URL:** <https://travis-ci.community/t/travis-ci-is-not-updating-git-submodule/13490>\
**Category:** Deployment\
**Created:** [December 30, 2022, 5:17pm UTC](https://travis-ci.community/t/travis-ci-is-not-updating-git-submodule/13490 "2022-12-30T17:17:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Northskool](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/northskool/32/8176_2.png) [@Northskool](https://travis-ci.community/u/Northskool)\
**Post date:** [December 30, 2022, 5:17pm UTC](https://travis-ci.community/t/travis-ci-is-not-updating-git-submodule/13490/1 "2022-12-30T17:17:27Z")

</div>

I have already created ssh-keygen and added as Deploy key in github, but still its giving permission denied

```auto
Submodule 'frontend' (git@github.com:appdev/frontend.git) registered for path 'frontend'
fatal: clone of 'git@github.com:(path)' into submodule path 
Failed to clone 'frontend'. Retry scheduled

The command "eval git submodule update --init --recursive " failed. Retrying, 2 of 3.

```

```auto

git:
  submodules: true
  quiet: true
  depth: false

```

my gitmodules file

```auto
.gitmodules

[submodule "frontend"]
    path = frontend
    url = git@github.com:northskool/frontend.git

```

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [December 30, 2022, 5:22pm UTC](https://travis-ci.community/t/travis-ci-is-not-updating-git-submodule/13490/2 "2022-12-30T17:22:08Z")

</div>

If a submodule needs to reference a specific deploy key (`key1`), you need to change the submodule URL using `git submodule set-url -- /path/to/submodule key1:northskool/frontend.git`.

You may have to run: `git submodule init`.

This will ultimately set the URL of the specified submodule to `<newurl>`. Then, it will automatically synchronize the submodule’s new remote URL configuration.

With `key1` a `Host` entry in your `~/.ssh/config`, as commented:

```auto
  Host key1
  Hostname github.com
  User git
  IdentityFile ~/.ssh/key1

```

In Travis, this would be defined in the `before_script` step in your `.travis.yml`.

We here at Travis have historically urged users to use user keys. You can add SSH keys to user accounts on GitHub. Most users have probably already done this to be able to clone the repositories locally.

You can add these keys through the Travis CLI:

```bash
travis sshkey --upload ~/.ssh/id_rsa -r myorg/main
Key description: Key to clone myorg/lib1 and myorg/key1
updating ssh key for myorg/main with key from ~/.ssh/id_rsa
Current SSH key: Key to clone myorg/lib1 and myorg/key2

```
