In case you have to git clone more than one private repository (be it through
git clone e.g. as a submodule, or through a dependency manager like CocoaPods or Carthage), you have to do two things:
- Setup your repos so that the same SSH key can be used for all the repositories
- Use the SSH git clone url (something like
email@example.com:bitrise-io/bitrise.io.git) instead of the HTTPS one (
- This step is crucial, as git hosting services only support SSH based authentication for the SSH git clone URLs, and not for the HTTP(S) git clone URLs. This means that if you use a HTTP(S) git clone URL, the service will ask for a username+password authentication, and will ignore the SSH key, even if the right one is available.
In case of this error (
could not read Username for 'https://github.com') the issue is the HTTP(S) git clone url - that should be replaced with the SSH git clone URL.
More information can be found on our DevCenter at: http://devcenter.bitrise.io/faq/adding-projects-with-submodules/
If you have any questions, just let us know!