You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I am able to clone a repository with ssh just fine.
git clone git@bitbucket.org:team-name/utils.git
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'...
me@bitbucket.org: 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://bitbucket.org/team-name/utils.git' into submodule path '/Users/me/code/my-project/utils' failed
Failed to clone 'utils'.
[submodule "utils"]
path = utils
url = ssh://bitbucket.org/team-name/utils.git
I've tried everything I can think of.
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://git@bitbucket.org/team-name/utils.git
The Second Way: specify the user in ~/.ssh/config
Host bitbucket.org
User git
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.