I have the following problem when I try to pull code using git Bash on Windows:
fatal: could not read Username for \'https://github.com\': No such file or dir
For me nothing worked from suggested above, I use git pull
from jenkins shell script and apparently it takes wrong user name. I spent ages before I found a way to fix it without switching to SSH.
In your the user's folder create .gitconfig file (if you don't have it already) and put your credentials in following format: https://user:pass@example.com
, more info. After your .gitconfig file link to those credentials, in my case it was:
[credential]
helper = store --file /Users/admin/.git-credentials
Now git will always use those credentials no matter what. I hope it will help someone, like it helped me.