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
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' }