Forward slash vs backward slash for file path in git bash
<p>I am running these two commands in <strong>Git bash</strong>.</p>

<p>Why they behave differently? Aren't they supposed to do the same thing or am I missing something?</p>

<pre><code>git diff &gt; D:\Patches\afterWGComment.txt  
</code></pre>

<p>creates file <code>PatchesafterWGComment.txt</code> in <code>D:/</code> </p>

<pre><code>git diff &gt; D:/Patches/afterWGComment.txt  
</code></pre>

<p>correctly creates file <code>afterWGComment.txt</code> in <code>D:/Patches/</code></p>

<p>Note that <code>D:/Patches/</code> folder is present before running the above commands.</p>