ok, our org has the code in an azure dev ops repo.
I have been trying to clone it via git command line on the mac, via sourcetree on the mac and via sourcetree on windows, with no luck.
I created a PAT in the azure git web UI.
on the mac, if I do:
$ git clone https://ourorg.visualstudio.com/CMS/_git/ourProj
Cloning into 'ourProj'...
Username for 'https://ourorg.visualstudio.com': xxx
Password for 'https://[email protected]':
fatal: Authentication failed for 'https://ourorg.visualstudio.com/CMS/_git/ourProj/'
For user, I tried my azure user, and I also tried the PAT. For pass, I tired my azure pass, and also the PAT.
None of these options work.
For sourcetree, I have also tried these combinations o PAT/PAT user/PAT user/pass etc. with no luck. Any suggestions?
This is the page I used to create the PAT:
https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops
This doc says to use the PAT as the user and pass, but this simply doesnt work.
the doc also says you can do this:
git clone https://anything:{yourPAT}@dev.azure.com/yourOrgName/yourProjectName/_git/yourRepoName
But this does not work either.
e.g. If I do this (fixed thanks to jessejouwing):
$ git clone https://asdf:{myPATgoesHERE}@dev.azure.com/ourorg/CMS/_git/ourProj
On windows I always get:
Cloning into 'ourProj'... fatal: Authentication failed for 'https://dev.azure.com/ourorg/CMS/_git/ourProj/'
The PAT is 100% correct.
Unfortunately, "alternative credentials" is disabled in our org, so we have to use PAT. PAT is not working, so I cant work.
git clone https://{yourPAT}@dev.azure.com/yourOrgName/yourProjectName/_git/yourRepoName
That should suffice.
Just click on Generate Git Credentials and use it to authenticate / clone your repo:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With