In our repository we have several small files with identical content. When one is removed from /foo/bar and one is added to /bar/foo these are wrongly shown as merge conflicts in Azure pull requests. How can one disable the git automatic rename detection for Azure pull requests? It’s straightforward to do it with git config for a repository but in this case I don’t have access to the repository as it’s hosted in Azure.
5
This is a wonderful example of an X-Y problem!
Your problem is:
You have a Pull Request in Azure DevOps that has merge conflicts.
But these aren’t just any old conflicts. They are caused because you have an “add/delete” conflict for different files and it’s only showing as a conflict because the file content is identical, and Git is incorrectly assuming this is a file rename. Git is obviously wrong here.
Since your Pull Request conflict is with Azure DevOps, and it’s caused by Git’s automatic rename detection, this led you to ask:
How can I disable git automatic rename for azure pull requests?
Your motivation is clear, but the answer to that specific question is (AFAIK), “You can’t.”
But the real question is,
What can I do when I have these specific types of conflicts?
And the answer to that is….[suspense building]
Resolve the conflict the same way you would any other conflict.
Update your feature branch how you normally would for a regular conflict via merge or rebase, push or force push your feature branch, and the PR will auto-update without a merge conflict.
2