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

How to clone repository with submodules


I have a repo with submodules. I need to access it via https.

The .gitmodules file has this format:

[submodule "submodules/sm1"]
path = submodules/sm1
url =

So if I git submodule update --init, it asks me for a user name (which disallows this from being a non-interactive session, which is pointless)

If I put the user within the url (as mentioned in, then I can use GIT_ASKPASS to do a git clone in a scriptable way.

But I don't want to use to put a specific and concrete user within the url in a submodule.

Is there a way to keep the .gitmodules file clean without any ad-hoc username, so I can share a repo between several developers; and also, clone it with its submodules in a scriptable way? None of the previous messages work, they always end up in git complaining about not having access rights.

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 09, 2022

Hi Francisco,

Is it a requirement to use HTTPS?

If so, please let me know, I'll need some time to look into it.


In case you are ok with using SSH instead, you can use an SSH URL for the repo in the .gitmodules file

[submodule "submodules/sm1"]
path = submodules/sm1
url =

SSH URLs do not include a username and authentication is done with SSH keys. This would require users to set up SSH Bitbucket Cloud (if they haven't already), and then authentication for each user will be done with the SSH keys each user has on their own computer.

After setting up an SSH, each user can create a file named config in their ~/.ssh folder with the following configuration, to ensure that the SSH key they generated is used when they connect to

User git
IdentityFile /Users/myUser/.ssh/id_rsa
IdentitiesOnly yes

where /Users/myUser/.ssh/id_rsa is the path to the private SSH key in the user's computer.


If you're using a script, you would need to have an SSH key pair on the machine where the script is running. If the script is used to only clone/pull, you could set up Access keys:

Otherwise, you would need the SSH keys of a user with access to the repo.


If you have any questions, please feel free to let me know.

Just a heads up, I moved your post to a new question. It's best to create a separate question if you need assistance with something, as a new question will have visibility to the rest of my team if I'm out of office, and also because a certain question can become difficult to follow if we try to troubleshoot multiple users' issues.


Kind regards,

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events