1

When trying to do a git-tfs clone from a TFVC repository hosted in VSTS, I got the following error, which aborted my clone operation.

I don't really want to mess with my client's codebase.

How can I resolve this error and get the clone operation to work?

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\7.2.1234.56024_U1_2017-10-09T10.21.44\Projects\FD072_FooBarIntegration\FooProConnectivity\Service References\FooProBIDataService\FooProConnectivity.FooProBIDataService.ReportListResponse.datasource.  
Specify a shorter path.
ulidtko
  • 14,740
  • 10
  • 56
  • 88
Dan Csharpster
  • 2,662
  • 1
  • 26
  • 50
  • 1
    Move the repository on your disk up a few levels, towards the root. If you're at the topmost level you're out of luck. – Lasse V. Karlsen Jun 19 '18 at 10:15
  • Good idea! Thank you! I created a one letter folder at the root, so that saves me 24 characters. So if I still run into this then, there is nothing I can do? Does that mean this repository cannot be cloned? I guess I could map a drive to a folder to reclaim one more character, but that's not saving me much. – Dan Csharpster Jun 19 '18 at 11:10

1 Answers1

2

I have added the '--workspace' option to manage this case and you will gain some more characters (you could set 'c:\w') and that should solve your problem.

See 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?

At the time, there was not long path support in the .Net framework (except using the win32 api that was a pain and doesn't worth the effort).

Now, there is a new long path support on recent framework but someone should do the development and do a pull request to fix that...

Philippe
  • 28,207
  • 6
  • 54
  • 78