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
Short Answer:
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/{USER_NAME}/{REPOSITORY_NAME}.git
git push --set-upstream origin master
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.