git checkout错误:无法在Windows 10中读取askpass响应

发布于 2025-01-13 15:28:10 字数 234 浏览 5 评论 0 原文

在 Android Studio 中克隆存储库时发生错误

错误:无法从
'C:\Users\User\AppData\Local\Google\AndroidStudio2021.1\tmp\intellij-git-askpass-local.sh'<读取askpass响应br> bash: /dev/tty: 没有这样的设备或地址
错误:执行提示脚本失败(退出代码 1)
致命:无法读取用户名

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

烟酒忠诚 2025-01-20 15:28:10

通过以下步骤解决了上述问题:

  1. 单击 Android Studio 的文件菜单 ->设置->展开版本控制
  2. 内部的版本控制,选择 Git &检查使用凭据助手

“在此处输入图像描述"

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

我爱人 2025-01-20 15:28:10

我只是通过使缓存无效并重新启动来解决它。

在 Android Studio 中,单击 File >使缓存无效...>勾选所有复选框>单击“无效并重新启动”

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

何以心动 2025-01-20 15:28:10

对于其他可能在任何 IntelliJ 产品(我的例子中是 WebStorm)遇到此问题的人,在插件下禁用 Gitlab 插件为我解决了这个问题。

感谢 Matthew 解决了这个问题:https://youtrack.jetbrains.com/issue/IDEA-326514/unable-to-read-askpass-response-intellij-git-askpass-local.sh#27-7969570.0-0

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

溺孤伤于心 2025-01-20 15:28:10

当 git 中的凭据突然被遗忘时,就会发生这种情况。
(我不明白为什么在项目工作一年后会发生这种情况)。

解决问题的步骤。

在项目文件夹中打开终端。

git config --global credential.helper store
git pull

指定您的用户名和密码。

如果您使用企业 GitLab,您可能需要使用令牌而不是密码(这取决于企业规则)。

GitLab 网站 ->你的头像->编辑个人资料->访问令牌 ->添加新令牌

不要设置“到期日期”(或者记住它并在旧令牌到期后重新生成新令牌)。

检查:

git fetch

现在您可以再次使用 IDEA 和 fetch/clone/etc。

经过这个步骤我解决了问题:

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

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
挽你眉间 2025-01-20 15:28:10

我只是通过使缓存无效并重新启动来解决它。

在 Android Studio 中,单击“文件”>“使缓存无效...>勾选所有复选框>单击“无效并重新启动”

这对我有用。

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.

南城追梦 2025-01-20 15:28:10

1-清理你的项目
2-赚取无效现金并重新启动您的项目
3-确保您选择干净的现金

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

ゃ人海孤独症 2025-01-20 15:28:10

您可以通过控制面板更新或添加新凭据

在此处输入图像描述

you can update or add new credentials through control panel

enter image description here

嘿咻 2025-01-20 15:28:10

在花了 5 个多小时尝试各种建议后 - 包括使缓存无效 - 使用凭据助手 - 不使用凭据助手,最终对我有用的是:

我正在使用 git LFS,但没有任何大文件要为这个特定项目上传。所以我禁用了它。我还禁用了 github 插件,但保留了 git 插件的活动状态。然后,我通过 SSH 进入该项目,并且仅使用终端命令 - 而不是 Intellij IDE。

另外,如果您尝试使用 github 密码进行身份验证,这对我来说不起作用。相反,在 github 网站上生成令牌并使用令牌 id 作为密码。

关于 SSH -

您可以使用 gpt 引导您完成如何设置 ssh - 但这里是我在该过程中所做的一些笔记。

github ssh:

  1. 生成 ssh 密钥: ssh-keygen -t ed25519 -C "[电子邮件受保护]"

  2. 将 ssh 密钥添加到 ssh代理(这是您的私有 ssh 密钥):eval "$(ssh-agent -s)" ssh-add /home/directory.sshkeys/ssh

*2 个文件将出现。 ssh.pub 文件是您需要将内容复制并粘贴到 github 下的文件:设置 -> SSH 和 GPG 密钥 -> 新 SSH 密钥

  1. 验证: ssh -T [电子邮件受保护]
  2. 更新远程 URL 以使用 SSH: git remote set-url origin [email protected]:tcdickson/Green-Collectives.git

之后,我能够解决一些合并问题并使用常规 git 命令进行推送。

一些新手命令:
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

在更新的 master 分支之上重新调整你的功能分支: git rebase master

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

小霸王臭丫头 2025-01-20 15:28:10

您可以签入使用凭据助手,它可以帮助您检查您的凭据,如果您之前没有进行设置,它会向您发送一个登录问题以创建凭据。
[1]: https://i.sstatic.net/IFG8x.png

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文