I'm working on Git. My Environment is Azure DevOps. I have a vsts build agent. I'm trying to pull only one folder from my repo on to the build agent. I'm using powershell. What I have tried is :
git init
git remote add origin https://MYUSERNAME:MYPERSONALACCESSTOKEN@mytfs-git-project-url
git config core.sparseCheckout true
Set-Content .git\info\space-checkout "myfolder/*" -Encoding Ascii
git pull origin master
I'm getting Authentication failed for username error. I can clone it locally using
"git clone https://MYPERSONALACCESSTOKEN@tfs-git-url"
, But if I try the same on Azure DevOps Powershell it gives the error as cannot read username error. I did try out the stackoverflow suggestions but it did not work. Any new suggestions are appreciated.