git checkout error: unable to read askpass response in Windows 10
Asked Answered
L

9

44

Error occurred while cloning repository in Android Studio

error: unable to read askpass response from
'C:\Users\User\AppData\Local\Google\AndroidStudio2021.1\tmp\intellij-git-askpass-local.sh'
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username

Lelandleler answered 13/3, 2022 at 12:23 Comment(0)
L
145

Resolved above issue with below steps:

  1. Click on the File Menu of Android Studio -> Settings -> Expand Version Control
  2. Inside Version Control, select Git & Check Use Credential Helper

enter image description here

Lelandleler answered 13/3, 2022 at 12:23 Comment(9)
I checked it but then what? what needs to happen?Cryptozoic
Then you start your checkout again, it will ask to enter your credentials.Lelandleler
With 'git push' and GitLab works too. For me, this answer could be the solution.Fishbolt
This solution does not help me. I have put login credential when an alert dialog pops from github but It's still showing error: unable to read askpass response from 'C:\Users\91700\AppData\Local\Google\AndroidStudio2021.2\tmp\intellij-git-askpass-local.sh' bash: /dev/tty: No such device or address error: failed to execute prompt script (exit code 1) fatal: could not read Username for 'https://github.com': No such file or directory Do you have any other solution please helpOptime
For me above solution worked after putting my credentials when asked while performing git fetch.Leathaleather
After the above step, I also had to restart Android Studio in order to workPak
What does this checkbox do?Aerometry
Thanks for the help, your answer saved a lot of time. Add to answer that Android Studio should be restarted (preferably via "invalidate cache and restart") in order to workPelargonium
not working for me, I am using Gitlab. I am not getting dialog popup to enter username and password. :(Mcleroy
D
17

I simply resolved it by doing Invalidate Caches and Restart.

In Android Studio, Click on File > Invalidate Caches... > tick all checkboxes > Click Invalidate and Restart

Denning answered 21/6, 2022 at 15:3 Comment(2)
Clear VCS Log Caches and Indexes was enough for meColorimeter
this method is also working on PHP Storm and Web Storm.Givens
S
3

For others that may be having this issue with any IntelliJ product (WebStorm in my case), disabling the Gitlab plugin under plugins solved the issue for me.

Credit to Matthew for figuring this out: https://youtrack.jetbrains.com/issue/IDEA-326514/unable-to-read-askpass-response-intellij-git-askpass-local.sh#27-7969570.0-0

Stalinsk answered 23/8, 2023 at 16:41 Comment(0)
P
2

It’s happens when credential in git are forgotten suddenly. (I don’t understand why it happens with me after year of working at project).

Steps to solve problem.

Open terminal in project’s folder.

git config --global credential.helper store
git pull

Specify your username and password.

If you use corporate GitLab probably you need to use token INSTEAD of password (it depends from corporate rules).

GitLab site -> Your avatar -> Edit profile -> Access Tokens -> Add new token

Don’t set “Expiration date” (or remember about it and re-generate new token after expiration of old token).

Check:

git fetch

Now you can use IDEA and fetch/clone/etc again.

After this steps I solved problem:

error: unable to read askpass response from '/home/***/.cache/JetBrains/IntelliJIdea2023.2/tmp/intellij-git-askpass-local.sh'
fatal: could not read Username for 'https://git.***.com': No such device or address
Precinct answered 16/8, 2023 at 5:15 Comment(0)
H
1

I simply resolved it by doing Invalidate Caches and Restart.

In Android Studio, Click on File > Invalidate Caches... > tick all checkboxes > Click Invalidate and Restart

this worked for me.

Hotshot answered 6/9, 2022 at 13:34 Comment(0)
I
0

1- clean your project 2- make invalid cash and restart your project 3- make sure you select the clean cash

Imagery answered 20/2, 2023 at 20:4 Comment(0)
P
0

you can update or add new credentials through control panel

enter image description here

Pyknic answered 5/10, 2023 at 11:47 Comment(0)
C
0

After spending 5+ hours trying various recommendations suggested - to include invalidating caches - using credential helper - not using credential helper, what finally worked for me:

I was using git LFS, but did't have any large files to upload for this particular project. So I disabled that. I also disabled the github plugin, but left the git plugin active. Then, I SSH'd into the project, and only used terminal commands - not the Intellij IDE.

Also, if you're trying to authenticate using your github password, that did not work for me. Instead, generate a token on the github website and use the token id as the password.

On to the SSH -

you can use gpt to walk you through how to set up your ssh - but here are some notes i took on the process.

github ssh:

  1. generate ssh key : ssh-keygen -t ed25519 -C "[email protected]"

  2. add ssh key to ssh agent (this is your private ssh key):eval "$(ssh-agent -s)" ssh-add /home/directory.sshkeys/ssh

*2 files will appear. The ssh.pub file is the one you need to copy and paste contents into github under settings->SSH and GPG keys->New SSH Key

  1. Authenticate: ssh -T [email protected]
  2. update the remote URL to use SSH: git remote set-url origin [email protected]:tcdickson/Green-Collectives.git

after this, I was able to troubleshoot a few merge issues and use regular git commands to push.

Some newbie commands: git pull origin master

git checkout master

git merge master

git merge origin/master

git push origin master

git pull origin master --allow-unrelated-histories

Rebase your feature branch on top of the updated master branch: git rebase master

Cawley answered 28/11, 2023 at 16:16 Comment(0)
T
-3

You can check in Use credential helper which helps you check your credential and if you didn't set up that before it would send you a question to login for create credential. [1]: https://i.sstatic.net/IFG8x.png

Tibold answered 19/4, 2022 at 2:45 Comment(1)
duplicate answerSava

© 2022 - 2024 — McMap. All rights reserved.