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

34.4k Views Asked by At

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

9

There are 9 best solutions below

9
On BEST ANSWER

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

0
On

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

1
On

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.stack.imgur.com/IFG8x.png

0
On

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

2
On

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

0
On

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
0
On

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

0
On

you can update or add new credentials through control panel

enter image description here

0
On

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.