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

GitGithub

Git Problem Overview


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?

Git Solutions


Solution 1 - Git

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.

Solution 2 - Git

I tried following command and it worked for me

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

Solution 3 - Git

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

git@github.com: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

Solution 4 - Git

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.

Solution 5 - Git

This seems to be a known bug in Git 1.8.5 on Windows. As described and reported by @Mr_and_Mrs_D:

https://groups.google.com/forum/#!msg/msysgit/s4dB8Nv9V4c/55-cGPdPYmAJ

Downgrading to 1.8.4 works for me. Please note you have to explicitly uninstall 1.8.5 first by running C:\Program Files (x86)\Git\unins000.exe as described here:

https://github.com/swcarpentry/bc/issues/234#issuecomment-33055444

I downloaded 1.8.4 here: https://msysgit.googlecode.com/files/Git-1.8.4-preview20130916.exe

Solution 6 - Git

In my case, I update Git to version 1.9 and this issue is fixed.

During push/commit, the Git Bash will ask for Github's account & password.

Solution 7 - Git

I used git-credential-winstore before. When I reinstalled my Windows, that error popep up. I resolve the issue by downloading git-credential-winstore again in my PATH.

Solution 8 - Git

For me the issue was i hadnt rw access to /dev/tty. Adding my user to tty group solved the problem (gpasswd -a tty).

Solution 9 - Git

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

caused a following error, which could be fixed only by recreating the build: ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

so don't try it unless you know what you're doing!

Solution 10 - Git

I ran into this error when I had a nonexistent github repository configured as a project dependency.

Solution 11 - Git

I had this issue also using GitHub from Visual Studio. I went to Team Explorer->Manage Connections->Connect a Project then Select Github which re-authenticated me in the web browser. I was then able to push my changes.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJohnDoe66View Question on Stackoverflow
Solution 1 - GitRodrigo MedeirosView Answer on Stackoverflow
Solution 2 - GitPulkitView Answer on Stackoverflow
Solution 3 - GitMr_and_Mrs_DView Answer on Stackoverflow
Solution 4 - GitRicardoView Answer on Stackoverflow
Solution 5 - GitAndyLView Answer on Stackoverflow
Solution 6 - GitDio PhungView Answer on Stackoverflow
Solution 7 - GitKevin TongView Answer on Stackoverflow
Solution 8 - GitAri MalinenView Answer on Stackoverflow
Solution 9 - GithoubenaView Answer on Stackoverflow
Solution 10 - GitMatthias WinkelmannView Answer on Stackoverflow
Solution 11 - GitMustafaView Answer on Stackoverflow