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

前端 未结 17 1337
自闭症患者
自闭症患者 2020-12-02 18:13

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         


        
17条回答
  •  孤城傲影
    2020-12-02 18:42

    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:

    • The SSH key was generated
    • SSH key was added to github, still had this error.
    • I've made a new repository on GitHub for this project and followed the steps described

    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.

提交回复
热议问题