git-tfs clone error: path contains more than the allowed 259 characters

git-tfs clone error: path contains more than the allowed 259 characters

尝试从 VSTS 中托管的 TFVC 存储库进行 git-tfs 克隆时,出现以下错误,导致我的克隆操作中止。

我真的不想弄乱我客户的代码库。

如何解决此错误并使克隆操作生效?

error: a problem occurred when trying to clone the repository. Try to solve the problem described below. 
In any case, after, try to continue using command `git tfs fetch`
One or more errors occurred. 
TF400889: The following path contains more than the allowed 259 characters: 
C:\code\client1\foo\.git\~w\Releases.2.1234.56024_U1_2017-10-09T10.21.44\Projects\FD072_FooBarIntegration\FooProConnectivity\Service References\FooProBIDataService\FooProConnectivity.FooProBIDataService.ReportListResponse.datasource.  
Specify a shorter path.

我添加了“--workspace”选项来管理这种情况,您将获得更多字符(您可以设置 'c:\w'),这应该可以解决您的问题。

https://github.com/git-tfs/git-tfs/blob/master/doc/commands/clone.md#set-a-custom-tfs-workspace-directory

So if I still run into this then, there is nothing I can do?

当时,.Net 框架中没有长路径支持(除了使用 win32 api 很痛苦,不值得努力)。

现在,最近的框架上有一个新的长路径支持,但应该有人进行开发并提出拉取请求来解决这个问题...