How to set a git config variable to the empty value from the command line
<p>I am inside a corporate network that requires a proxy to be set up to access servers outside the intranet.</p>

<p>So, to be able to <code>git clone</code> from, say, github we have set up the <code>HTTP_PROXY</code> environment variable. That works fine.</p>

<p>However, we also have an internal git server. To properly access that we must <em>not</em> use the proxy. It works if I set this up in the <code>.gitconfig</code> file:</p>

<pre><code>[http "http://stash.fabricam.com/"]
    proxy = 
</code></pre>

<p>Since the proxy is set to the empty value here, no proxy is used for <code>git clone</code> from the server in question.</p>

<p>However, I would like to be able to create this configuration in a script, using <code>git config --global</code>. But I can't figure out how to do it.</p>

<p>These do not work</p>

<pre><code>git config --global http.http://stash.fabricam.com/ ""
git config --global http.http%3A%2F%2Fstash.fabricam.com%2F ""
git config --global http.http%3A%2F%2Fstash.fabricam.com%2F ''
git config --global --add http.http%3A%2F%2Fstash.fabricam.com%2F
</code></pre>

<p>As you can see I have tried to use the <a href="https://stackoverflow.com/questions/6172719/escape-character-in-git-proxy-password/6172831#6172831">percent encoding</a>, but that does not help.</p>

<p>I have read <a href="https://stackoverflow.com/questions/15884180/how-to-override-git-config-options-by-command-line-parameters">this post</a>, but I don't want to set this on every command, I really want to modify the <code>.gitconfig</code> file.</p>

<p>I have attempted setting up the <code>no_proxy</code> environment variable, but <code>git</code> does not seem to notice it.</p>

<p>I am in a Windows environment, running git 2.7.1</p>

<p><strong>edit</strong></p>

<p>Thanks to @choroba I got a bit further.</p>

<p>The behavior of this command is different depending on the shell:</p>

<pre><code>git config --global http."http://stash.fabricam.com/".proxy ''
</code></pre>

<ul>
<li><p>In <code>PowerShell</code>, this does nothing at all.</p></li>
<li><p>In <code>cmd.exe</code> </p></li>
</ul>

<p>it creates this setting</p>

<pre><code>[http "http://stash.fabricam.com/"]
    proxy = ''
</code></pre>

<p>But <em>that does not work</em>. The empty string is not the same as no string at all. It will result in this behavior:</p>

<pre><code>&gt; git clone http://stash.fabricam.com/test.git
Cloning into 'test'...
fatal: unable to access 'http://stash.fabricam.com/test.git/':
 Couldn't resolve proxy ''''
</code></pre>

<ul>
<li>In <code>bash</code> (that comes with git on windows) the command <em>does</em> work, and sets up the correct empty value. But I'd rather not script in bash when on windows, so this is not a good solution for me.</li>
</ul>