When try to pull/push a git repo from Source Tree I was getting this error. After installing and re-installing Source Tree and Git I was still getting the error. This was preventing me from updating the git repo or pulling changes. One setting was to blame for the issue.
It turns out the issue was the 'add proxy server configuration to Git/Mercurial' option was ticked under options > network. I'm not sure how this got ticked as it wasn't previously but un-ticking this and saving solved the issue.