Fatal: could not read username for 'https //github.com' device not configured
Asked Answered
D

12

68

I am trying to push code to github with SublimeGit plugin, but something weird occurs to me.

Pushing to https://github.com/username/username.github.io.git

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

Have been taken a lot of search before asking, like fatal: could not read Username for 'https://github.com': No such file or directory, Fatal: could not read Username for 'https://github.com': No such device or address.

But problem still remains, any effort will be appreciated.

Dunham answered 27/10, 2016 at 1:5 Comment(1)
Does this answer your question? GitHub Action: fatal: could not read Username for 'https://github.com': Device not configuredHelaine
B
70

You get that error (fatal: could not read Username for 'https://github.com': Device not configured) when git needs to ask for a username or password and (a) the only mechanism available to it is to ask on the console and (b) there is no console available (git is not attached to a tty device, i.e., you're not running git interactively).

This commonly happens in an environment where you are invoking git from some sort of gui tool and no appropriate credentials helper has been configured.

There are a variety of ways of addressing this problem:

  • One of the easiest is to move to using ssh authentication rather than https.

  • You could hardcode the credentials for github into your local git repository, as described in the gitcredentials documentation.

  • You could configure an appropriate helper application. One may already be configured, but git may simply not be able to find it. The gitcredentials man page has information on this option as well.

Badalona answered 27/10, 2016 at 1:39 Comment(8)
"@bower_components/jquery.balloon.js": "github.com/urin/jquery.balloon.js.git#^1.0.3"Wycoff
If anybody using SourceTree, similar error was fixed by going to Preferences -> tab Git -> section Git version -> button Use System Git, and select from the dialog 'git'. It appears that after an update it forgot where it's command line tools areVoiced
After converting to ssh don't forget to change your remote url gist.github.com/developius/c81f021eb5c5916013dcGrannia
@Voiced answer helped me. Just remember to restart SourceTree then it worksSkive
@Voiced That did it for me too. Thanks you. Could you perhaps put that in a dedicated answer? From your upvotes it looks like it helps many people.Purusha
@Voiced - setting credential.helper to sourcetree did it for me. Source: gist.github.com/RockinPaul/6b012b106c4175469ee39bde12fb67f7Forcefeed
@Voiced Bless you!! i'll post that as an answer maybe it is easier for others to see thisAcrylic
In our case, we were trying to pull from a repo that was accidently set as pravite. Normally if we run git pull we were asked to input username, but the interaction is impossible during a Jenkins pipeline process, so an error was thrown "No such device or address". Updating the repo to "public" fixed our issue.Enliven
G
87

Mac OS: Android Studio Preferences -> Git -> at bottom, Use Credentials helper (make sure it is checked)

Windows: Android Studio File -> Settings -> Git -> Check Credentials Helper at bottom

Goins answered 16/4, 2022 at 15:6 Comment(3)
Thanks, this one solved it for me, but I had to restart Android Studio as well before the push actually worked for me.Hubris
after this need restart android studio and made push againRogan
And now Preferences has been renamed to Settings in macOS VenturaWorship
B
70

You get that error (fatal: could not read Username for 'https://github.com': Device not configured) when git needs to ask for a username or password and (a) the only mechanism available to it is to ask on the console and (b) there is no console available (git is not attached to a tty device, i.e., you're not running git interactively).

This commonly happens in an environment where you are invoking git from some sort of gui tool and no appropriate credentials helper has been configured.

There are a variety of ways of addressing this problem:

  • One of the easiest is to move to using ssh authentication rather than https.

  • You could hardcode the credentials for github into your local git repository, as described in the gitcredentials documentation.

  • You could configure an appropriate helper application. One may already be configured, but git may simply not be able to find it. The gitcredentials man page has information on this option as well.

Badalona answered 27/10, 2016 at 1:39 Comment(8)
"@bower_components/jquery.balloon.js": "github.com/urin/jquery.balloon.js.git#^1.0.3"Wycoff
If anybody using SourceTree, similar error was fixed by going to Preferences -> tab Git -> section Git version -> button Use System Git, and select from the dialog 'git'. It appears that after an update it forgot where it's command line tools areVoiced
After converting to ssh don't forget to change your remote url gist.github.com/developius/c81f021eb5c5916013dcGrannia
@Voiced answer helped me. Just remember to restart SourceTree then it worksSkive
@Voiced That did it for me too. Thanks you. Could you perhaps put that in a dedicated answer? From your upvotes it looks like it helps many people.Purusha
@Voiced - setting credential.helper to sourcetree did it for me. Source: gist.github.com/RockinPaul/6b012b106c4175469ee39bde12fb67f7Forcefeed
@Voiced Bless you!! i'll post that as an answer maybe it is easier for others to see thisAcrylic
In our case, we were trying to pull from a repo that was accidently set as pravite. Normally if we run git pull we were asked to input username, but the interaction is impossible during a Jenkins pipeline process, so an error was thrown "No such device or address". Updating the repo to "public" fixed our issue.Enliven
G
17

I just closed Android Studio and started it again. The problem is fixed.

Glyceryl answered 24/8, 2022 at 12:53 Comment(2)
Unbelievable, tnx) got forget to restart guys..Metathesize
Unbelievable... Worked like a charm!Smoothie
A
3

@codrus's comment helped me fixing the issue on sourcetree Go to Preferences -> tab Git -> section Git version -> button Use System Git, and select from the dialog 'git'.

Acrylic answered 20/9, 2021 at 12:26 Comment(0)
W
3

This Gist helped a lot! Just 3 commands.

Wallen answered 3/10, 2022 at 19:8 Comment(1)
In my case, git was configured with sourcetree, fixing back to Mac OS keychain worked for me -> git config credential.helper osxkeychainInductile
K
3

What solved it for me was this:

  1. I restarted android studio
  2. I ran flutter pub get
  3. Github then asked me for my username and password. I entered them. The password I entered was my github access token, not my actual github password.

Hope it helps someone.

Kienan answered 29/6, 2023 at 21:25 Comment(1)
Helped me. I was using Gitlab, and got the same issue. Thanks!Waterfall
J
1

Check this option in Android Studio File -> Settings -> Git -> Credentials Helper

If its not working even after checking 'Credentials helper' in settings then only restart the Android Studio and try to push code again.

Jasperjaspers answered 19/8, 2022 at 8:47 Comment(0)
W
1

I restarted the Android Studio and it worked for me

Wehner answered 31/8, 2022 at 12:36 Comment(0)
H
0

On Mac Updating keychain access entry for github worked for me.

refer this answer for details on how to update keychain access entry.

Hawaiian answered 23/8, 2022 at 12:44 Comment(0)
F
0

This should help solve this problem, since support for password authentication was removed on August 13, 2021.Please download and instal Git Credential Manager: https://github.com/GitCredentialManager/git-credential-manager/releases/tag/v2.0.785 Then you can use Android Studio and push all changes. After push Git Credential Manager will ask you for validation, and all should works perfect after all.

Falkner answered 23/8, 2022 at 14:34 Comment(0)
C
0

If you are on google colab, running the clone command on the terminal instead of the notebook will, most probably, do the trick.

Cathycathyleen answered 14/5, 2023 at 16:14 Comment(0)
M
-2

For me, just install Github client for Mac fixed the issue.

Mendoza answered 1/7, 2022 at 21:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.