title: Clone a repo with submodules: override credentials
body: <p>I have to <em>automate</em> cloning a repository and fetching it's all submodules. The urls for repository submodules are specified at <code>.gitmodules</code>. If I were to go with defaults I would just do</p>
  
  <pre><code>git clone --recursive https://username:password@url.git
  </code></pre>
  
  <p>The problem is credentials aren't included in <code>.gitmodules</code> file and I am prompted for those when I clone. I have to use HTTPS rather then SSH.</p>
  
  <p>I tried to submit the credentials using git config:</p>
  
  <pre><code>git clone https://username:password@url.git my_repo
  cd my_repo
  git submodule init
  git config submodule.my_submodule.url "https://username:password@url/my_submodule.git"
  git submodule update
  </code></pre>
  
  <p>but I get prompted for credentials in the last update step. I've checked that the submodule url is correct and has proper credentials in <code>.git/config</code> file.</p>