How do I use git-tfs and idiomatic git branching against a TFS repository?

It’s now possible to get the TFS branches to be correct Git branches if cloning using git-tfs. This is now in the stable release! You first clone not the entire repository but the trunk :

git tfs clone http://<tfsurl>:8080 $/main/trunk

Then you run branch --init, which creates a new branch in the Git repository

git tfs branch --init $/MyProject/MyTFSBranch

in your case :

git tfs branch --init $/main/feature-logon

Or use the the --all flag on a fresh cloned repository to create ALL the branches present on the TFS server.

git tfs branch --init --all

You could also clone directly with all the branches using flag --with-branches:

git tfs clone http://<tfsurl>:8080 $/main/trunk --with-branches

The documentation for this new command is here. Feel free to provide feedback to improve it…

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)