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

前端 未结 17 1314
自闭症患者
自闭症患者 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:33

    For me nothing worked from suggested above, I use git pull from jenkins shell script and apparently it takes wrong user name. I spent ages before I found a way to fix it without switching to SSH.

    In your the user's folder create .gitconfig file (if you don't have it already) and put your credentials in following format: https://user:pass@example.com, more info. After your .gitconfig file link to those credentials, in my case it was:

    [credential] helper = store --file /Users/admin/.git-credentials

    Now git will always use those credentials no matter what. I hope it will help someone, like it helped me.

提交回复
热议问题