Git in Android Studio cannot get a password from intellij-git-askpass
Your error
error: unable to read askpass response from '/home/<user>/.cache/Google/AndroidStudio<version>/tmp/intellij-git-askpass-local.sh'1 more line it can showFix it fast
Most common cause, 1 of 2Android Studio's askpass script ran, but the IDE gave it no answer
In Settings > Version Control > Git, turn on Use credential helper, so the IDE stops overriding helpers and Git asks a helper you configure.
# a helper that ships with Git: keeps the password in memory for a while
git config --global credential.helper cacheShort answer
error: unable to read askpass response from intellij-git-askpass-local.sh means Git asked Android Studio's askpass script for a username or password and got no answer. Either the IDE could not reply, or GIT_ASKPASS still names a script from an IDE session that has ended. Turn on Use credential helper in the Git settings, or unset GIT_ASKPASS.
Which cause do you have?
Print the three settings Git consults before it falls back to a terminal prompt: the GIT_ASKPASS variable, core.askPass and credential.helper. The output shows whether Git is wired to the IDE's script and whether any helper could answer instead.
echo "GIT_ASKPASS=$GIT_ASKPASS"
git config --show-origin --get-all core.askPass
git config --show-origin --get-all credential.helperThen find the line you see in this list and open its fix:
- 1Android Studio's askpass script ran, but the IDE gave it no answer
The push or pull is started from Android Studio (menu or built-in terminal), GIT_ASKPASS names the intellij-git-askpass script, and no credential.helper is set - 2GIT_ASKPASS or core.askPass still points at a script from an IDE session that is gone
The error appears in a terminal outside the IDE, or the path in the message names an older IDE folder than the version you run now
What does the error look like?
error: unable to read askpass response from '/home/<user>/.cache/Google/AndroidStudio<version>/tmp/intellij-git-askpass-local.sh'fatal: could not read Username for 'https://bitbucket.org':
Cause 1 of 2
Android Studio's askpass script ran, but the IDE gave it no answer
You seeThe push or pull is started from Android Studio (menu or built-in terminal), GIT_ASKPASS names the intellij-git-askpass script, and no credential.helper is set
Check
Git reports unable to read askpass response from the intellij-git-askpass script when that helper exits without printing a username or password. By default the IDE overrides any credential helper and answers Git's prompts itself through this script, so when the IDE side cannot reply, Git has nothing to read and moves on to a terminal prompt that a GUI push does not have.
# inside Android Studio's terminal
echo "$GIT_ASKPASS"
git ls-remote originFix
In Settings > Version Control > Git, turn on Use credential helper, so the IDE stops overriding helpers and Git asks a helper you configure. Set one helper for the machine, then push again and sign in once in the Git login dialog.
# a helper that ships with Git: keeps the password in memory for a while
git config --global credential.helper cacheVerify
Pushing again asks for credentials once, then works without the askpass error.
git push --dry-runConfirmed by jetbrains.com
Cause 2 of 2
GIT_ASKPASS or core.askPass still points at a script from an IDE session that is gone
You seeThe error appears in a terminal outside the IDE, or the path in the message names an older IDE folder than the version you run now
Check
When the askpass error shows up outside Android Studio, Git is still being told to use the IDE's script. Git checks GIT_ASKPASS first, then core.askPass, then SSH_ASKPASS, and only then prompts on the terminal, so a value exported in a shell profile or written into the global Git config sends every prompt to a script that has no running IDE behind it.
grep -n "ASKPASS" ~/.bashrc ~/.zshrc ~/.profile 2>/dev/null
git config --show-origin --get-all core.askPassFix
Remove the stale setting so Git falls through to a helper or the terminal prompt: unset the variable for this shell, delete the export from your profile, and drop core.askPass if it names the IDE script.
unset GIT_ASKPASS
git config --global --unset core.askPassVerify
A new terminal prints an empty GIT_ASKPASS, and the next push prompts in the terminal or uses your helper.
echo "GIT_ASKPASS=$GIT_ASKPASS"
git push --dry-runConfirmed by git-scm.com
How do I stop it coming back?
- Configure one credential.helper per machine, so Git never depends on an IDE window being open to authenticate.
- Never export GIT_ASKPASS in a shell profile; leave it to the tool that launches Git.
- Keep core.askPass out of the global Git config unless a tool you control needs it, and check it after moving to a new IDE version.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: QistLock, Nuclear Home Video.