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

前端 未结 3 752
天涯浪人
天涯浪人 2020-12-07 16:27

How Do I Use git-tfs Idiomatically?

  • The git idiom is to check out branches to the root directory of the repository. Checking out a branch will re

3条回答
  •  一个人的身影
    2020-12-07 17:04

    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://: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://:8080 $/main/trunk --with-branches
    

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

提交回复
热议问题