0

The git-tfs tool allows you to clone TFS branches to Git repositories. One way of displaying the available TFS branches is to use the git-tfs list-remote-branches command, which (at the end) states: "Cloning root branches (marked by [*]) is recommended!"

Simply put, why? I don't see any particular benefit in cloning root branches... what if you want to clone a child branch? What's so good about root branches?

Jez
  • 27,951
  • 32
  • 136
  • 233
  • where are you reading this information? Could you post the URL or literal text of the message? – Kritner Aug 24 '15 at 19:19
  • Here's the [source code](https://github.com/git-tfs/git-tfs/blob/master/GitTfs/Commands/ListRemoteBranches.cs#L61) for the command. – Jez Aug 24 '15 at 19:38
  • Only a guess, but perhaps it just wants to call out the fact unless you're cloning trunk you may be cloning a feature branch, or something that is intended as someone's "play area" rather than trunk. If cloning something from github, I would more often be cloning the main branch/stable branch/trunk over a dev/feature branch. – Kritner Aug 24 '15 at 20:15

1 Answers1

0

OK, I think I figured out the answer to my own question.

If you clone a root branch, git-tfs clones all the child branches too (which is why root branches are preferred) - however, it doesn't initialize them in the git repository by default! You must specify the --with-branches parameter to get it to do this. Then, you will see the root branch and all its child branches initialized after checkout when you do a git branch command.

Jez
  • 27,951
  • 32
  • 136
  • 233