Error when push commits with Github: fatal: could not read Username

Since few time, I use Github for my projects and I have an issue when I want to push commits.

To beginning, I have forked a repository. Then I have cloned the fork (with command line git clone https://github.com/ ...) and, after doing modifications, I have committed with success (git commit -a).

After this, I have tried to push commits with command line git push but I obtain the following error:

fatal: could not read Username for 'https://github.com': No such file or directory

Have you got an idea to resolve this issue?


What I had to do was:

git remote rm origin
git remote add origin '[email protected]:username/repo.git'

Then, I was able to push my changes.


I tried following command and it worked for me

git push https://<username>:<password>@github.com/<username>/<repository-name>

Well I had the same problem - what annoys me to no end is that I don't have a clue why (edit: bug). I was pushing with https. Manually editing the config did not work for me (or doing a chkdsk as suggested in another answer). I ended up pushing with ssh - as in, replace:

https://github.com/USER/REPO.git

with

[email protected]:USER/REPO.git

after generating your keys

EDIT as to why : it is a bug in 1.8.5. See the report and a discussion with a way to workaround


Since it's a bug from 1.8.5 version, if you don't want use SSH Key you can downgrade to 1.84 from here, or upgrade to higher version, 1.9.x, for example.