Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

submodule update fails with ssh, but clone works


I am able to clone a repository with ssh just fine.

git clone

However, when this same repo is included as a submodule in another project, I get a Permission Denied (public key) error.

Here is the exact output I get 

$ git submodule update
Cloning into '/Users/me/code/my-project/utils'... Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'ssh://' into submodule path '/Users/me/code/my-project/utils' failed
Failed to clone 'utils'.

I want to re-iterate that I definitely have access to the repository and am able to clone the repository via ssh without any problems. This ONLY happens when the repository is included as a submodule in another project.

This is the content of my .gitmodules file
[submodule "utils"]
= utils
url = ssh://

I've tried everything I can think of.

  • Deleted all ssh keys
  • Regenerated keys (and added to Bitbucket account)
  • I've run ssh -T (it works)

I am on macOS Monterey (12.1).
git version 2.32.0 (Apple Git-132)

I followed the ssh setup instructions multiple times.

1 answer

1 accepted

2 votes
Answer accepted

I found out that I needed to specify the user for the submodule command.

There are two ways to do this (maybe more?)


The First way: specify the user in the url 

Change the value of the url field in the .gitmodules so it includes the username

url = ssh://


The Second Way: specify the user in ~/.ssh/config

    User git

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events