title: Cloning Git Repo using TFS Personal Access Token
body: <p>I am trying to programmatically clone a git repository. My ASP.NET MVC application is creating and starting a process. The code to handle the processes works correctly however the authentication is failing when trying to use a TFS on premise PAT to clone a git repository. I cannot use NTLM or require the user to enter credentials. I can confirm my C# code handling creating processes to use the git bash shell programmatically works as I have no issue on my local machine but in production on IIS the issue arises. I have tried the following two methods. </p>
  
  <p><strong>Method 1</strong>: git clone http://<strong>anyusername</strong>:PAT@tfs2017:8080/tfs/DefaultCollection/_git/Git%20Repository</p>
  
  <p><strong>PAT</strong> is the token I have generated for my user. I have tried to encode it in base64 as well. </p>
  
  <p><strong>Method 2</strong>: As suggested by a person on a MS social forum. </p>
  
  <p>git -c http.extraheader="AUTHORIZATION:bearer {<strong>base64encodedPAT</strong>}"  clone {<strong>url</strong>}</p>
  
  <p><strong>Original MS Forum Question for Reference:</strong> <a href="https://social.msdn.microsoft.com/Forums/vstudio/en-US/0107cf1f-7fe4-4429-af74-ca7d2be7405e/using-personal-access-tokens-in-tfs-2017?forum=tfsversioncontrol" rel="noreferrer">https://social.msdn.microsoft.com/Forums/vstudio/en-US/0107cf1f-7fe4-4429-af74-ca7d2be7405e/using-personal-access-tokens-in-tfs-2017?forum=tfsversioncontrol</a></p>