TFS source control case sensitivity
Asked Answered
K

2

7

TFS has a funny habit of mixing up case in folders. For example, some developers might check in $/FooBar/readme.txt while others may check in $/Foobar/readme.txt.

Is there anyway to force TFS to treat files/folders as case-sensitive?

For example, if a folder $/FooBar/ already exists, when someone adds $/foobar/readme2.txt, the folder casing would be updated to be $/FooBar/readme2.txt since that already exists.

For the most part users won't notice this, but internally in the TFS database, this can cause confusion in other tools (like git-tfs).

Krystalkrystalle answered 19/3, 2012 at 19:19 Comment(3)
What kind of problems does this cause in git-tfs?Kowatch
You'll get duplicate entries of the same file in Git. git ls-tree master would show both FooBar/readme.txt and Foobar/readme.txt. This causes git to always think something has changed, when it hasn't.Krystalkrystalle
This seems to be the bug tracker issue in the GIT-TFS which tracks this issue: github.com/git-tfs/git-tfs/issues/104Legendary
E
6

Unfortunately once a folder has been checked-in its case remains persistent in TFS.

The workaround is to rename:

tf rename $Project//FooBar $/Project/foobar/

Source: http://kb.teamprise.com/article/view/52

Exocentric answered 19/3, 2012 at 21:12 Comment(1)
And this does work, but it's kind of a weird hack. I was hoping for a way to prevent it from happening in the first place.Krystalkrystalle
L
3

There is a check-in policy that ships with the Team Foundation Server Power tools, which will allow you to specify regex patterns to allow or disallow. You might be able to cobble something together with that.

You can find the check-in policy on the Visual Studio Power tools site.

A tutorial on how to specify patterns for this tool can be found here.

Further more, TFS does treat files and directories as case sensitive in TFS 11 and forward, Martin Woodward demonstrated this in his presentation on the ALM Summit last November, but as in Windows it doesn't matter, it won't complain if you're on a windows host. If you're using Team Foundation Everywhere, you'll see that on a linux filesystem case sensitivity is preserved. It's a platform thing..

Legendary answered 20/3, 2012 at 16:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.