I have the following problem when I try to pull code, using GIT Bash on windows
I already tried to implement the accepted solution provided here:
but the problem persists. After adding/removing origin I still get the same error.
fatal: could not read Username for 'https://github.com': No such file or directory
This error can also happen when trying to clone an invalid HTTP URL. For example, this is the error I got when trying to clone a GitHub URL that was a few characters off:
It actually happened inside Emacs, though, so the error in Emacs looked like this:
So instead of a helpful error saying that there was no such repo at that URL, it gave me that, sending me on a wild goose chase until I finally realized that the URL was incorrect.
This is with git version 2.7.4.
I'm posting this here because it happened to me a month ago and again just now, sending me on the same wild goose chase again. >:(
I faced the exact same problem. This problem occurred when I cloned using HTTPS URL and then tried to push the changes using Git Bash on Windows using:
However, when I used SSH URL to clone, this problem didn't occur:
Short Answer:
Ignore first three lines if it's not a new repository.
Longer description:
Just had the same problem, as non of the above answers helped me, I have decided to post this solution that worked for me.
Few Notes:
As the command line tool I used GitShell (for Windows, I use Terminal.app on Mac).
GitShell is official GitHub tool, can be downloaded from https://windows.github.com/
Hope this helps to anyone who has the same problem.
If you want to continue use https instead ssh, and avoid type into your username and password for security reason.
You can also try Github OAuth token, then you can do
git config remote.origin.url 'https://{token}@github.com/{username}/{project}.git'
orgit remote add origin 'https://{token}@github.com/{username}/{project}.git'
This works for me!
Follow the steps to setup SSH keys here: https://help.github.com/articles/generating-ssh-keys
OR
I fixed this by installing a newer version of Git. The version I installed is 2.10.2 from https://git-scm.com. See the last post here: https://www.bountysource.com/issues/31602800-git-fails-to-authenticate-access-to-private-repository-over-https
With newer Git Bash, the credential manager window pops up and you can enter your username and password, and it works!