Hi Sven,
Thank you for posting here.
The personal access tokens (PAT) is for the specific user, in your scenario it should be
User A.
That means it only can be used by UserA, If you are running the git clone command with user B, the PAT will not available.
However, just as you said you can run with User B but specify the User A and its password as the credential.
Just as John said in
this thread : In general, we don't recommend using PATs when using Git for Windows to interact with TFS on-prem. You can do this, with the http.extraheader config variable in git:
git -c http.extraheader="AUTHORIZATION:bearer {base64-encoded-pat}" clone {url}
However, that's clearly not ideal. I recommend using either NTLM, or using SSH key authentication for a seamless experience:
https://www.visualstudio.com/en-us/docs/git/use-ssh-keys-to-authenticate
Best Regards.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.