gitsvntfsgit-svngit-tf

How do I work around "TFS does not support having the same item with different cases in the same path."


I'm currently trying to migrate a SVN repository to TFS (specifically visualstudio.com). I looked around and found the cheapest and easiest option is to go via GIT, as is detailed in this post.

The process was going well, I used GIT SVN to build the GIT repository locally, and managed to commit more than half the change sets into TFS, but it stopped when I got the following error:

git-tf: item 'solution/schema objects/programmability/stored procedures/dbo.product_recommendation_insert.proc.sql' exists in commit 9fbd60d more than once with different casing. TFS does not support having the same item with different cases in the same path.

While this isn't ideal, but I don't really need to keep the commit history for this file and skipping it would be completely fine.

So I came up with a solution (if there's a better option ignore the next bit) and that was to use GIT filter-branch to nuke it from history. I ran the following command:

git filter-branch --tree-filter 'rm -f ''solution\Schema Objects\Programmability\Stored Procedures\dbo.Product_recommendation_insert.proc.sql''' HEAD

Which ran fine, but now I'm not sure what I need to do to complete my commit to TFS. When I re-run the checkin I get the following error

git-tf: the latest changes (commit 968e8a0) have been fetched but have not been merged/rebased into master yet. Please merge/rebase the latest changes into master

So my question is: am I doing the right thing by using filter-branch? And if so, what do I need to do to "merge/rebase" into master?


Solution

  • Looks like a slightly different filter-branch command (the one mentioned here) doesn't leave me with the same issue:

    git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ''solution\Schema Objects\Programmability\Stored Procedures\dbo.Product_recommendation_insert.proc.sql''' --prune-empty --tag-name-filter cat -- --all