Welcome to Microsoft Q&A platform and thanks for posting your question here.
As I understand your query, you are trying to set up GIT repo within ADF workspace which are in different tenants and you are facing this error: "Invalid Git configuration. You need to gain access to the repository before you can publish any changes. Details: Incorrect account name for the given tenant." Please correct me if my understanding is wrong.
- Could you please use a different browser or a private/incognito mode to see if the issue persists.
- Additionally, make sure that you have the necessary permissions to access the repository in the other tenant.
- Make sure you select "Default Directory" instead of "Microsoft Account" while logging in the ADO organization while setting up the GIT repository for ADF. If you have created your ADO account using Microsoft directory, then
Additional helpful resources:
https://www.reddit.com/r/AZURE/comments/sbru6f/data_factory_cant_connect_to_azure_devops_repo/
https://learn.microsoft.com/en-us/azure/data-factory/cross-tenant-connections-to-azure-devops
If none of these suggestions resolve the issue, I would recommend you to raise a support ticket so that you could be provided further assistance in troubleshooting the issue.
Hope it helps. Kindly accept the answer by clicking on Accept answer
button.