4

C:\>git tf clone https://companyname.visualstudio.com/DefaultCollection $/companyname/Main OldTFS --deep

This only gets me main branch history. That was git tf.

C:\>git tfs clone https://companyname.visualstudio.com/DefaultCollection $/companyname/Main --with-branches

This fails after fetching few branches at one of the merge changesets saying that Please report this case to the git-tfs developpers! (report here : https://github.com/git-tfs/git-tfs/issues/461 ). git branch gives me this

Release/20120719.1
Sprint/Sprint044
Sprint/Sprint045
Sprint/Sprint047
Sprint/Sprint048
Sprint/Sprint049
Sprint/Sprint050
*master

I've branches upto Sprint085 and quite a few release branches also. That was git tfs

Is there any way with git tf that I can fetch few other branches which properly creates merge commits so that I can see the history properly?

IsmailS
  • 10,797
  • 21
  • 82
  • 134

1 Answers1

5

Disclamer: I am the one that added the branch support to git-tfs...

Forget git tf it doesn't support branches.

This fails after fetching few branches at one of the merge changesets saying that I should inform them with the details so they can improve.

Perhaps you should have followed the link given by git-tfs ;)

The link was this one. In the message there, you are informed of a work in progress to have a better branch support.

You should really try it. It is in really good shape and permit to support 2 other branch patterns : branch renamed and baseless merge. With this 2 last patterns, I hope we could support all the branch patterns (but because TFS is very suprising --in the bad meaning-- and a lot messy, I can't guarranty!)

If you can't have all your branches supported, it will remain the manual way to do it! But very long :

  • clone only the branch in another repository
  • fetch this branch in your main repository
  • use grafts to link your branch to its parent branch (that you should find manualy in TFS. Good luck because TFS is very bad at that!)
  • [optional] use git filter-branch to make the link permanent.

PS : perhaps you could even write a little script to automate all that...

Philippe
  • 28,207
  • 6
  • 54
  • 78
  • I checkout [this](https://github.com/pmiossec/git-tfs/tree/rename_branch) branch. But not able to compile it. :( – IsmailS Mar 12 '14 at 14:50
  • sorry, cloning recursively now. – IsmailS Mar 12 '14 at 14:54
  • We have even created branches of sub-directories in TFS (in old branches which we don't use now). Could that be a reason of failing? – IsmailS Mar 12 '14 at 15:15
  • I don't know. Never tested because that's not the case we try to managed. That's one of the horrible that never be done but that TFS let you do :( Try by yourself. Perhaps with some luck.... – Philippe Mar 12 '14 at 15:26
  • I've started cloning my TFS with branches. And I've also attached a debugger with few conditional break points. Do you want to know anything specific where it fails? Like about the changeset where it failed etc? – IsmailS Mar 12 '14 at 15:44
  • It turns out that, there was a file which in our TFS which has long path i.e. greater than 259 characters. `TF400889: The following path contains more than the allowed 259 characters: ` – IsmailS Mar 13 '14 at 05:21
  • Sorry, the above error had occurred while cleaning the folder after the original error occurred. – IsmailS Mar 13 '14 at 05:55
  • There is an [workspace option](https://github.com/git-tfs/git-tfs/blob/master/doc/commands/clone.md#set-a-custom-tfs-workspace-directory) for that – Philippe Mar 13 '14 at 09:14
  • `Do you want to know anything specific where it fails? Like about the changeset where it failed etc?` I have already tried remote debugging and in such task, it's nearly impossible (problem too complex). Either correct the problem yourself (and contribute your solution), either try to reproduce the case on a public tfs repository (hint: codeplex) and open an issue on [git-tfs project forum](https://github.com/git-tfs/git-tfs/issues) that we could work on it... – Philippe Mar 13 '14 at 09:45
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/49639/discussion-between-isid-and-philippe) – IsmailS Mar 13 '14 at 09:57