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 :
- git – destination path already exists and is not an empty directory
- git – fatal: This operation must be run in a work tree
- git – Push rejected, failed to compile Node.js app heroku
- git – SourceTree keeps asking for Github password
- Visual Studio Code how to resolve merge conflicts with git?
- 502 Whoops, GitLab is taking too much time to respond
- Issue with SourceTree while cloning a GitHub repository
- Git merge is not possible because I have unmerged files
- Revert a range of commits in git