7

I have been trying to push the code to Github but getting error as below.

$ git push fatal: cannot run /snap/code/79/usr/share/code/resources/app/extensions/git/dist/askpass.sh: No such file or directory

Iam able to push by providing username and Personal access Token but it valid for only in that push command. Next time when i try to push the code it is again asking for credentials followed by the error.

  • 1
    Probably a duplicate question. This will help you https://stackoverflow.com/questions/22147574/fatal-could-not-read-username-for-https-github-com-no-such-file-or-directo – Venkata N Bhupathi Nov 18 '21 at 05:47
  • Does this answer your question? [fatal: could not read Username for 'https://github.com': No such file or directory](https://stackoverflow.com/questions/22147574/fatal-could-not-read-username-for-https-github-com-no-such-file-or-directo) – bassxzero Nov 18 '21 at 05:52
  • Hi Venkata, But looking on the error we are getting it looks like an issue with other file. Also iam able to see the username and other details with command git config --list – Sreerag N Varier Nov 18 '21 at 05:54

4 Answers4

15

One solution that worked for me was to restart VS Code

Kevin Maiyo
  • 159
  • 1
  • 4
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Pankwood Feb 23 '22 at 14:59
1

Ya, simply restart your vs code and it will ask then for permission from GitHub when you will push your code to remote

nausif
  • 11
  • 1
0

vscode running as a snap could not get access to askpass to retrieve saved passwords in ubuntu

Hassan Khraibani
  • 303
  • 3
  • 11
-2

The error you're encountering suggests that Git is unable to locate the askpass.sh script required for authentication. Restarting your VSCode clear the error.

However, if it fails you can configure Git to use a different authentication method that doesn't rely on the askpass.sh script. You can use SSH keys for authentication, which will allow you to push code without entering your credentials each time.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 20 '23 at 20:33