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

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

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

Follow the steps to setup SSH keys here: https://help.github.com/articles/generating-ssh-keys

OR

git remote add origin https://{username}:{password}@github.com/{username}/project.git

Update: If you get fatal: remote origin already exists. then you have to use set-url:

git remote set-url origin https://{username}:{password}@github.com/{username}/project.git

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:

git clone https://github.com/{username}/{repo}.git

However, when I used SSH URL to clone, this problem didnt occur:

git clone [email protected]:{username}/{repo}.git

git reset –soft , which will keep your files, and stage all changes back automatically.

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

I found my answer here:

edit ~/.gitconfig and add the following:

[url [email protected]:]
 insteadOf = https://github.com/

Although it solves a different problem, the error code is the same…

Related posts on git  :

Leave a Reply

Your email address will not be published.