git – Could not resolve proxy:

In work I have a proxy, at home I don’t have a proxy

In work I set the proxy like:

  • How can I use Visual Studio to work with a Node.js project from an Openshift Git repository?
  • Does GitHub Enterprise support shallow cloning?
  • Overwrite unstaged commits due to gitattributes eol settings
  • Jenkins Git plugin detached HEAD
  • updating submodules with git-flow
  • Unauthorized Fingerprint
  •     git config - -global  http.proxy
        git config - -global  https.proxy

    At home I remove the proxy like

        git config --global --unset http.proxy
        git config --global --unset https.proxy

    I’m trying to push something to my git repo with

        git push -u origin master

    And I get

        Could not resolve proxy:

    The .gitconfig file looks like this.

            name = first last
            email =
            default = current
            excludesfile = /Users/first.last/.gitignore_global
        [difftool "sourcetree"]
            cmd = opendiff \"$LOCAL\" \"$REMOTE\"
            path = 
        [mergetool "sourcetree"]
            cmd = /Applications/ \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
            trustExitCode = true
        [filter "media"]
            clean = git media clean %f
            smudge = git media smudge %f
            required = true

    How do I remove the proxy ?

  • Cordova Custom Plugin “Arguments to path.join must be strings”
  • Git workflow with upstream and origin and Heroku staging and production
  • Where should I upload the built file of a github branch?
  • Keep remote directory up to date using git
  • Managing releases on github
  • How to tell git to ignore subdirectories (which are part of the repository) for operations like git status
  • 3 Solutions collect form web for “git – Could not resolve proxy:”

    Check the environment variables with :

    $echo $http_proxy
    $echo $https_proxy
    $echo $HTTPS_PROXY
    $echo $HTTP_PROXY

    if any of these environment variables are set then unset them by just using http_proxy= then enter will unset those

    $export http_proxy=
    • If below variables are set just delete all when working on network without proxy (Example @home)

      //Computer=>System properties=>Advanced=>Environment Variables
    • Unset git proxy

      git config --global --unset http.proxy
      git config --global --unset https.proxy

    Both steps together worked for me in Windows.

    Similar to other answers (especially the one by @harip) but if you’re on a Mac or such, check the .bash_profile file in the user’s home directory (e.g. cat ~/.bash_profile).
    Mine had these set during another program’s install:

    export HTTP_PROXY=
    export HTTPS_PROXY=

    Move that file to the side (e.g. mv ~/.bash_profile ~/.bash_profile-hide).
    Then start a new Terminal window (which will reload environment variables). If you don’t start a new Terminal window, any existing ones will still have the variables set and need to be cleared manually.

    Git Baby is a git and github fan, let's start git clone.