title: Why does HTTP Basic Auth works using `git -c http.extraHeader="Authorization: Basic <base64>"`, but not when putting credentials directly in the URL?
body: <p>I've the following &quot;dummy&quot; credentials (username and PAT) for accessing a repository:</p>
  <pre><code>bd6164:o6g5xae5fmqeqdbjatdfjichdk55lweq4jxyt2jvwtjuzxdwwgxa
  </code></pre>
  <p>Now, according to MS documentation, I should supply these credentials to <code>git</code> using <code>git -c http.extraHeader=&quot;Authorization: Basic &lt;base64&gt;&quot; ...</code>, which results in successful authentication.</p>
  <p>However, if I supply these credentials to <code>git</code> directly in the URL:</p>
  <p><code>https://bd6164:o6g5xae5fmqeqdbjatdfjichdk55lweq4jxyt2jvwtjuzxdwwgxa@azuredevops.example.net</code></p>
  <p>then authentication fails.</p>
  <p>Normally, when I use <code>git</code>, I can put my credentials directly in the URL for successful authentication, so why do I experience these inconsistencies? In general, aren't credentials in the URL converted to Base64 and sent in a &quot;Authorization: Basic&quot; HTTP header?</p>
  <p>Here is the documentation from MS on how to use PAT with <code>git</code>:</p>
  <p><a href="https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&amp;tabs=preview-page#use-a-pat" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&amp;tabs=preview-page#use-a-pat</a></p>
  <p><strong>Works</strong>:</p>
  <pre><code># git -c http.extraHeader=&quot;Authorization: Basic YmQ2MTY0Om82ZzV4YWU1Zm1xZXFkYmphdGRmamljaGRrNTVsd2VxNGp4eXQyanZ3dGp1enhkd3dneGE=&quot; clone https://azuredevops.example.net/Main/MyProj/_git/MyRepo
  </code></pre>
  <p><strong>Fails</strong>:</p>
  <pre><code># git clone https://bd6164:o6g5xae5fmqeqdbjatdfjichdk55lweq4jxyt2jvwtjuzxdwwgxa@azuredevops.example.net/Main/MyProj/_git/MyRepo
  </code></pre>