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

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

    For those getting this error in a Jenkins pipeline, it can be fixed by using an SSH Agent plugin. Then wrap your git commands in something like this:

    sshagent(['my-ssh-key']) {
        git remote set-url origin git@github.com:username/reponame.git
        sh 'git push origin branch_name'
    }
    

提交回复
热议问题