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:

  • git: How to redo a merge conflict resolution (before committing the merge)?
  • git-svn trying to commit to wrong branch
  • Git mergetool vs difftool
  • Multiple GIT projects in a folder
  • Keep a git feature branch up to date with master branch by pulling directly from the master
  • Uploading Specific Vendor files with Laravel's Envoyer
  •     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 ?

  • Is there a way to see all the versions of a file using git?
  • After “git svn clone”, I still don't have fantastic branch-merging commit?
  • How should I structure my Git repositories with my .NET Solution?
  • How does Git know I renamed a file when I did not, but intended?
  • wso2-emm app management version bug
  • git wildcard - remove all instances of a subdirectory
  • 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.