Fatal: could not read Username for 'https://github.com': Device not configured

I have read the help on setting up SSH for a user that has access to all repo’s - I just added the Bitrise public key to my account which has access to all repos (admin). I keep getting the error:

fatal: could not read Username for 'https://github.com': Device not configured

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:

  1. Setup your repos so that the same SSH key can be used for all the repositories
  2. Use the SSH git clone url (something like git@github.com:bitrise-io/bitrise.io.git) instead of the HTTPS one (https://github.com/bitrise-io/bitrise.io.git).
    • 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!

1 Like