Reputation: 43
Before diving in the question, a little background:
A couple months ago, my team migrate our repo from Team Foundation Server to Azure DevOps. Last week, we noticed that one branch on the TFS had work done on it which is now needed. So we decided to bring that branch to Azure in order to avoid doing the said work again.
I cloned the repo from TFS on my machine, change the url of origin to match the one of Azure and then tried to push the branch with the following steps :
It gave me the following error message :
error: remote unpack failed: error The tree object 1234 was rejected: The folder 'myfolder' and the folder 'MyFolder' pushed differ in case. You must remove or rename one of them or disable case-enforcement (see https://aka.ms/git-platform-compat). To https://urlOfRepoOnAzure ! [remote rejected] ExportBranche -> ExportBranche (The tree object 5678 was rejected: The folder 'myfolder' and the folder 'MyFolder' pushed differ in case. You must remove or rename one of them or disable case-enforcement (see https://aka.ms/git-platform-compat).) error: failed to push some refs to https://urlOfRepoOnAzure
I deleted the folder "myfolder" and tried again. Same error. But I'm able to push to TFS wihtout any problems at all.
I don't understand what's going on. Especially why the push to Azure is rejected since I'm pushing a new branch.
Upvotes: 2
Views: 6079
Reputation: 4301
I agree with @BernardoDuarte that you should be able to change the policy about case enforcement, but if it's not working, I would try to get out of the way of the whole conflict by doing a more manual update:
git status
in (B) to make sure that the folder case of myFolder is the same as it is in the Azure DevOps repo.If you overwrite myFolder itself, Git will track that as a change and try to push it. This approach, while admittedly clumsy, prevents that change from ever happening, and should bypass the issue.
Upvotes: 1
Reputation: 4264
You can try following this link and change your repository settings on Azure Repos regarding your Policies about Case enforcement.
Upvotes: 1