Q: how to clone git repository with submodules without asking for password for every subrepository I'm recently put a repository into bitbucket. And this repository has some submodules
I'm working on a Initialization script. I would like to clone the main directory and them pull all subdirectories.
 git clone https://bitbucket.org/#####/main.git elastic --recurse-submodules

this prompts me for the user and password. 
Username for 'https://bitbucket.org': myuser 
Password for 'https://myuser@bitbucket.org': 

and them it asks me again for every submodule
Username for 'https://bitbucket.org':  
...

My .gitmodules file is like:
[submodule "api"]
     path = app/api/
     url = git@bitbucket.org/###/api.git
     branch = master
[submodule "front"]
     path = app/front
     url = git@bitbucket.org/###/front.git
     branch = master
[submodule "app/config"]
     path = app/config
     url = git@bitbucket.org/###/config.git
     branch = master

... some few more repositories

How can I clone the main repository and them use the same credentials to all childs repositories?
I'm using AWS AMI Linux.

A: Setting up the git to use the credential memory cache solves my problem
git config --global credential.helper cache

this is enough to pull all repos with the same user/password
If i want to keep the same cache for a entire day, I'm able to set the time for a longer timespan:
git config --global credential.helper 'cache --timeout=86400'

86400 seconds = 1 day;

A: Check your git config output:
type: git config -l
If you see a rule like:
git config --global url.https://github.com/.insteadOf git@github.com/

That would explain why credentials for an HTTPS URL are used even for submodules.
