2

I have a problem with git submodule update --init --remote. I receive errors: Permission denied and Failed to clone. But I added SSH keys to my github repository. I can pull, push, git clone.

I have all needed accesses. I use OS Windows 10. I changed in .gitmodules file url=git@github.com:xxx to url=https://github.com/xxx , but not helped.

Sviat
  • 33
  • 1
  • 5

1 Answers1

7

Git will try to clone the submodule using ssh and not https. If you haven't configured your ssh key this will fail. Either change the URL from git@github.com to https://github.com in the .gitmodule file else please follow the steps which might fix the problem.

  1. Delete the folder of the submodule from your local.

  2. Open gitBash and run the following commands.

    git submodule sync
    git submodule update --init
    
Dharman
  • 30,962
  • 25
  • 85
  • 135
Ashwini
  • 771
  • 10
  • 5