How Can I Configure GitHub Desktop/Windows to Work with a Proxy?

raphael picture raphael · Jul 27, 2016 · Viewed 22.9k times · Source

New to working with git in Windows. I downloaded the GitHub Desktop application and can connect my account, but doing pushes/pulls fails because of an unresolved host. Asking around the workplace I got the following suggestion to type this command into the git shell.

git config --global http.proxy http://username:[email protected]:8080

Does this:

  1. Store my password in plain text?
  2. Send my password in plain text?

Doesn't GitHub for Desktop generate and use SSH keys instead (I got an email notification when I first connected my account)? How can I configure GitHub Desktop to work with this proxy?

Answer

Sayan Mandal picture Sayan Mandal · Jan 8, 2018

To directly add a proxy to Github Desktop without using git shell:

  1. Set up/Sign in to your account in Github Desktop(This won't be a problem, proxy only doesn't allow you to Add, create or clone repo)

  2. Close Github Desktop for the time being(to set up proxy).

  3. Go to C:\Users\@yourusername.

  4. There you will find a file named .gitconfig

  5. Open it with any text editor(I have used sublime text 3) and add

[http] proxy = http://username:[email protected]:8080

and save.

  1. Now you can add, create and clone repos in Github Desktop.

Note(for TFS users): TFS will return 502 bad gateway error when you use the above proxy configuration. Use hash # to comment out the proxy config in .gitconfig to switch between Git and TFS.